From 2ed989c1802a43c3dde7d19e30c0cd26e667822b Mon Sep 17 00:00:00 2001 From: 06wj <06wj@163.com> Date: Wed, 18 May 2016 15:16:17 +0800 Subject: [PATCH] v1.0.1 --- CHANGELOG.md | 30 + Changelog.md | 2 - build/amd/hilo-amd.js | 2294 +++++++++-------- build/amd/hilo-amd.min.js | 8 +- build/amd/hilo-amd.zip | Bin 180077 -> 176152 bytes build/amd/hilo/core/Class.js | 41 +- build/amd/hilo/core/Class.min.js | 2 +- build/amd/hilo/core/Hilo.js | 128 +- build/amd/hilo/core/Hilo.min.js | 4 +- build/amd/hilo/event/EventMixin.js | 56 +- build/amd/hilo/event/EventMixin.min.js | 4 +- build/amd/hilo/game/Camera.js | 35 +- build/amd/hilo/game/Camera.min.js | 2 +- build/amd/hilo/game/Camera3d.js | 109 +- build/amd/hilo/game/Camera3d.min.js | 4 +- build/amd/hilo/game/ParticleSystem.js | 113 +- build/amd/hilo/game/ParticleSystem.min.js | 2 +- build/amd/hilo/geom/Matrix.js | 75 +- build/amd/hilo/geom/Matrix.min.js | 2 +- build/amd/hilo/loader/ImageLoader.js | 11 +- build/amd/hilo/loader/ImageLoader.min.js | 2 +- build/amd/hilo/loader/LoadQueue.js | 73 +- build/amd/hilo/loader/LoadQueue.min.js | 2 +- build/amd/hilo/loader/ScriptLoader.js | 11 +- build/amd/hilo/loader/ScriptLoader.min.js | 2 +- build/amd/hilo/media/HTMLAudio.js | 59 +- build/amd/hilo/media/HTMLAudio.min.js | 2 +- build/amd/hilo/media/WebAudio.js | 81 +- build/amd/hilo/media/WebAudio.min.js | 2 +- build/amd/hilo/media/WebSound.js | 29 +- build/amd/hilo/media/WebSound.min.js | 2 +- build/amd/hilo/renderer/CanvasRenderer.js | 17 +- build/amd/hilo/renderer/CanvasRenderer.min.js | 4 +- build/amd/hilo/renderer/DOMRenderer.js | 22 +- build/amd/hilo/renderer/DOMRenderer.min.js | 2 +- build/amd/hilo/renderer/Renderer.js | 63 +- build/amd/hilo/renderer/Renderer.min.js | 2 +- build/amd/hilo/renderer/WebGLRenderer.js | 46 +- build/amd/hilo/renderer/WebGLRenderer.min.js | 4 +- build/amd/hilo/tween/Ease.js | 44 +- build/amd/hilo/tween/Ease.min.js | 2 +- build/amd/hilo/tween/Tween.js | 153 +- build/amd/hilo/tween/Tween.min.js | 2 +- build/amd/hilo/util/TextureAtlas.js | 36 +- build/amd/hilo/util/TextureAtlas.min.js | 2 +- build/amd/hilo/util/Ticker.js | 40 +- build/amd/hilo/util/Ticker.min.js | 2 +- build/amd/hilo/util/drag.js | 21 +- build/amd/hilo/util/drag.min.js | 2 +- build/amd/hilo/util/polyfill.js | 8 +- build/amd/hilo/util/polyfill.min.js | 4 +- build/amd/hilo/view/Bitmap.js | 36 +- build/amd/hilo/view/Bitmap.min.js | 4 +- build/amd/hilo/view/BitmapText.js | 54 +- build/amd/hilo/view/BitmapText.min.js | 2 +- build/amd/hilo/view/Button.js | 58 +- build/amd/hilo/view/Button.min.js | 2 +- build/amd/hilo/view/CacheMixin.js | 22 +- build/amd/hilo/view/CacheMixin.min.js | 2 +- build/amd/hilo/view/Container.js | 130 +- build/amd/hilo/view/Container.min.js | 2 +- build/amd/hilo/view/DOMElement.js | 31 +- build/amd/hilo/view/DOMElement.min.js | 4 +- build/amd/hilo/view/Drawable.js | 29 +- build/amd/hilo/view/Drawable.min.js | 2 +- build/amd/hilo/view/Graphics.js | 262 +- build/amd/hilo/view/Graphics.min.js | 2 +- build/amd/hilo/view/Sprite.js | 108 +- build/amd/hilo/view/Sprite.min.js | 4 +- build/amd/hilo/view/Stage.js | 78 +- build/amd/hilo/view/Stage.min.js | 4 +- build/amd/hilo/view/Text.js | 61 +- build/amd/hilo/view/Text.min.js | 4 +- build/amd/hilo/view/View.js | 154 +- build/amd/hilo/view/View.min.js | 2 +- build/cmd/hilo-cmd.js | 2294 +++++++++-------- build/cmd/hilo-cmd.min.js | 8 +- build/cmd/hilo-cmd.zip | Bin 180014 -> 176080 bytes build/cmd/hilo/core/Class.js | 41 +- build/cmd/hilo/core/Class.min.js | 4 +- build/cmd/hilo/core/Hilo.js | 128 +- build/cmd/hilo/core/Hilo.min.js | 4 +- build/cmd/hilo/event/EventMixin.js | 56 +- build/cmd/hilo/event/EventMixin.min.js | 4 +- build/cmd/hilo/game/Camera.js | 35 +- build/cmd/hilo/game/Camera.min.js | 2 +- build/cmd/hilo/game/Camera3d.js | 109 +- build/cmd/hilo/game/Camera3d.min.js | 4 +- build/cmd/hilo/game/ParticleSystem.js | 113 +- build/cmd/hilo/game/ParticleSystem.min.js | 2 +- build/cmd/hilo/geom/Matrix.js | 75 +- build/cmd/hilo/geom/Matrix.min.js | 4 +- build/cmd/hilo/loader/ImageLoader.js | 11 +- build/cmd/hilo/loader/ImageLoader.min.js | 2 +- build/cmd/hilo/loader/LoadQueue.js | 73 +- build/cmd/hilo/loader/LoadQueue.min.js | 2 +- build/cmd/hilo/loader/ScriptLoader.js | 11 +- build/cmd/hilo/loader/ScriptLoader.min.js | 2 +- build/cmd/hilo/media/HTMLAudio.js | 59 +- build/cmd/hilo/media/HTMLAudio.min.js | 2 +- build/cmd/hilo/media/WebAudio.js | 81 +- build/cmd/hilo/media/WebAudio.min.js | 2 +- build/cmd/hilo/media/WebSound.js | 29 +- build/cmd/hilo/media/WebSound.min.js | 2 +- build/cmd/hilo/renderer/CanvasRenderer.js | 17 +- build/cmd/hilo/renderer/CanvasRenderer.min.js | 4 +- build/cmd/hilo/renderer/DOMRenderer.js | 22 +- build/cmd/hilo/renderer/DOMRenderer.min.js | 2 +- build/cmd/hilo/renderer/Renderer.js | 63 +- build/cmd/hilo/renderer/Renderer.min.js | 2 +- build/cmd/hilo/renderer/WebGLRenderer.js | 46 +- build/cmd/hilo/renderer/WebGLRenderer.min.js | 4 +- build/cmd/hilo/tween/Ease.js | 44 +- build/cmd/hilo/tween/Ease.min.js | 2 +- build/cmd/hilo/tween/Tween.js | 153 +- build/cmd/hilo/tween/Tween.min.js | 2 +- build/cmd/hilo/util/TextureAtlas.js | 36 +- build/cmd/hilo/util/TextureAtlas.min.js | 2 +- build/cmd/hilo/util/Ticker.js | 40 +- build/cmd/hilo/util/Ticker.min.js | 2 +- build/cmd/hilo/util/drag.js | 21 +- build/cmd/hilo/util/drag.min.js | 2 +- build/cmd/hilo/util/polyfill.js | 8 +- build/cmd/hilo/util/polyfill.min.js | 4 +- build/cmd/hilo/view/Bitmap.js | 36 +- build/cmd/hilo/view/Bitmap.min.js | 4 +- build/cmd/hilo/view/BitmapText.js | 54 +- build/cmd/hilo/view/BitmapText.min.js | 2 +- build/cmd/hilo/view/Button.js | 58 +- build/cmd/hilo/view/Button.min.js | 2 +- build/cmd/hilo/view/CacheMixin.js | 22 +- build/cmd/hilo/view/CacheMixin.min.js | 2 +- build/cmd/hilo/view/Container.js | 130 +- build/cmd/hilo/view/Container.min.js | 2 +- build/cmd/hilo/view/DOMElement.js | 31 +- build/cmd/hilo/view/DOMElement.min.js | 4 +- build/cmd/hilo/view/Drawable.js | 29 +- build/cmd/hilo/view/Drawable.min.js | 2 +- build/cmd/hilo/view/Graphics.js | 262 +- build/cmd/hilo/view/Graphics.min.js | 2 +- build/cmd/hilo/view/Sprite.js | 108 +- build/cmd/hilo/view/Sprite.min.js | 4 +- build/cmd/hilo/view/Stage.js | 78 +- build/cmd/hilo/view/Stage.min.js | 4 +- build/cmd/hilo/view/Text.js | 61 +- build/cmd/hilo/view/Text.min.js | 4 +- build/cmd/hilo/view/View.js | 154 +- build/cmd/hilo/view/View.min.js | 2 +- build/commonjs/core/Class.js | 41 +- build/commonjs/core/Class.min.js | 4 +- build/commonjs/core/Hilo.js | 128 +- build/commonjs/core/Hilo.min.js | 4 +- build/commonjs/event/EventMixin.js | 56 +- build/commonjs/event/EventMixin.min.js | 4 +- build/commonjs/game/Camera.js | 35 +- build/commonjs/game/Camera.min.js | 2 +- build/commonjs/game/Camera3d.js | 109 +- build/commonjs/game/Camera3d.min.js | 4 +- build/commonjs/game/ParticleSystem.js | 113 +- build/commonjs/game/ParticleSystem.min.js | 2 +- build/commonjs/geom/Matrix.js | 75 +- build/commonjs/geom/Matrix.min.js | 4 +- build/commonjs/hilo-commonjs.zip | Bin 108285 -> 104748 bytes build/commonjs/loader/ImageLoader.js | 11 +- build/commonjs/loader/ImageLoader.min.js | 2 +- build/commonjs/loader/LoadQueue.js | 73 +- build/commonjs/loader/LoadQueue.min.js | 2 +- build/commonjs/loader/ScriptLoader.js | 11 +- build/commonjs/loader/ScriptLoader.min.js | 2 +- build/commonjs/media/HTMLAudio.js | 59 +- build/commonjs/media/HTMLAudio.min.js | 2 +- build/commonjs/media/WebAudio.js | 81 +- build/commonjs/media/WebAudio.min.js | 2 +- build/commonjs/media/WebSound.js | 29 +- build/commonjs/media/WebSound.min.js | 2 +- build/commonjs/renderer/CanvasRenderer.js | 17 +- build/commonjs/renderer/CanvasRenderer.min.js | 4 +- build/commonjs/renderer/DOMRenderer.js | 22 +- build/commonjs/renderer/DOMRenderer.min.js | 2 +- build/commonjs/renderer/Renderer.js | 63 +- build/commonjs/renderer/Renderer.min.js | 2 +- build/commonjs/renderer/WebGLRenderer.js | 46 +- build/commonjs/renderer/WebGLRenderer.min.js | 4 +- build/commonjs/tween/Ease.js | 44 +- build/commonjs/tween/Ease.min.js | 2 +- build/commonjs/tween/Tween.js | 153 +- build/commonjs/tween/Tween.min.js | 4 +- build/commonjs/util/TextureAtlas.js | 36 +- build/commonjs/util/TextureAtlas.min.js | 2 +- build/commonjs/util/Ticker.js | 40 +- build/commonjs/util/Ticker.min.js | 2 +- build/commonjs/util/drag.js | 21 +- build/commonjs/util/drag.min.js | 2 +- build/commonjs/util/polyfill.js | 8 +- build/commonjs/util/polyfill.min.js | 4 +- build/commonjs/view/Bitmap.js | 36 +- build/commonjs/view/Bitmap.min.js | 4 +- build/commonjs/view/BitmapText.js | 54 +- build/commonjs/view/BitmapText.min.js | 2 +- build/commonjs/view/Button.js | 58 +- build/commonjs/view/Button.min.js | 2 +- build/commonjs/view/CacheMixin.js | 22 +- build/commonjs/view/CacheMixin.min.js | 2 +- build/commonjs/view/Container.js | 130 +- build/commonjs/view/Container.min.js | 2 +- build/commonjs/view/DOMElement.js | 31 +- build/commonjs/view/DOMElement.min.js | 4 +- build/commonjs/view/Drawable.js | 29 +- build/commonjs/view/Drawable.min.js | 2 +- build/commonjs/view/Graphics.js | 262 +- build/commonjs/view/Graphics.min.js | 2 +- build/commonjs/view/Sprite.js | 108 +- build/commonjs/view/Sprite.min.js | 4 +- build/commonjs/view/Stage.js | 78 +- build/commonjs/view/Stage.min.js | 4 +- build/commonjs/view/Text.js | 61 +- build/commonjs/view/Text.min.js | 4 +- build/commonjs/view/View.js | 154 +- build/commonjs/view/View.min.js | 2 +- build/dragonbones/dragonbones.js | 4 +- build/dragonbones/dragonbones.min.js | 6 +- build/flash/hilo-flash.js | 2 +- build/flash/hilo-flash.min.js | 2 +- build/kissy/hilo-kissy.js | 2294 +++++++++-------- build/kissy/hilo-kissy.min.js | 8 +- build/kissy/hilo-kissy.zip | Bin 181457 -> 177537 bytes build/kissy/hilo/core/Class.js | 41 +- build/kissy/hilo/core/Class.min.js | 2 +- build/kissy/hilo/core/Hilo.js | 128 +- build/kissy/hilo/core/Hilo.min.js | 4 +- build/kissy/hilo/event/EventMixin.js | 56 +- build/kissy/hilo/event/EventMixin.min.js | 4 +- build/kissy/hilo/game/Camera.js | 35 +- build/kissy/hilo/game/Camera.min.js | 2 +- build/kissy/hilo/game/Camera3d.js | 109 +- build/kissy/hilo/game/Camera3d.min.js | 4 +- build/kissy/hilo/game/ParticleSystem.js | 113 +- build/kissy/hilo/game/ParticleSystem.min.js | 2 +- build/kissy/hilo/geom/Matrix.js | 75 +- build/kissy/hilo/geom/Matrix.min.js | 2 +- build/kissy/hilo/loader/ImageLoader.js | 11 +- build/kissy/hilo/loader/ImageLoader.min.js | 2 +- build/kissy/hilo/loader/LoadQueue.js | 73 +- build/kissy/hilo/loader/LoadQueue.min.js | 2 +- build/kissy/hilo/loader/ScriptLoader.js | 11 +- build/kissy/hilo/loader/ScriptLoader.min.js | 2 +- build/kissy/hilo/media/HTMLAudio.js | 59 +- build/kissy/hilo/media/HTMLAudio.min.js | 2 +- build/kissy/hilo/media/WebAudio.js | 81 +- build/kissy/hilo/media/WebAudio.min.js | 2 +- build/kissy/hilo/media/WebSound.js | 29 +- build/kissy/hilo/media/WebSound.min.js | 2 +- build/kissy/hilo/renderer/CanvasRenderer.js | 17 +- .../kissy/hilo/renderer/CanvasRenderer.min.js | 4 +- build/kissy/hilo/renderer/DOMRenderer.js | 22 +- build/kissy/hilo/renderer/DOMRenderer.min.js | 2 +- build/kissy/hilo/renderer/Renderer.js | 63 +- build/kissy/hilo/renderer/Renderer.min.js | 2 +- build/kissy/hilo/renderer/WebGLRenderer.js | 46 +- .../kissy/hilo/renderer/WebGLRenderer.min.js | 4 +- build/kissy/hilo/tween/Ease.js | 44 +- build/kissy/hilo/tween/Ease.min.js | 2 +- build/kissy/hilo/tween/Tween.js | 153 +- build/kissy/hilo/tween/Tween.min.js | 2 +- build/kissy/hilo/util/TextureAtlas.js | 36 +- build/kissy/hilo/util/TextureAtlas.min.js | 2 +- build/kissy/hilo/util/Ticker.js | 40 +- build/kissy/hilo/util/Ticker.min.js | 2 +- build/kissy/hilo/util/drag.js | 21 +- build/kissy/hilo/util/drag.min.js | 2 +- build/kissy/hilo/util/polyfill.js | 8 +- build/kissy/hilo/util/polyfill.min.js | 2 +- build/kissy/hilo/view/Bitmap.js | 36 +- build/kissy/hilo/view/Bitmap.min.js | 4 +- build/kissy/hilo/view/BitmapText.js | 54 +- build/kissy/hilo/view/BitmapText.min.js | 2 +- build/kissy/hilo/view/Button.js | 58 +- build/kissy/hilo/view/Button.min.js | 2 +- build/kissy/hilo/view/CacheMixin.js | 22 +- build/kissy/hilo/view/CacheMixin.min.js | 2 +- build/kissy/hilo/view/Container.js | 130 +- build/kissy/hilo/view/Container.min.js | 2 +- build/kissy/hilo/view/DOMElement.js | 31 +- build/kissy/hilo/view/DOMElement.min.js | 4 +- build/kissy/hilo/view/Drawable.js | 29 +- build/kissy/hilo/view/Drawable.min.js | 2 +- build/kissy/hilo/view/Graphics.js | 262 +- build/kissy/hilo/view/Graphics.min.js | 2 +- build/kissy/hilo/view/Sprite.js | 108 +- build/kissy/hilo/view/Sprite.min.js | 4 +- build/kissy/hilo/view/Stage.js | 78 +- build/kissy/hilo/view/Stage.min.js | 4 +- build/kissy/hilo/view/Text.js | 61 +- build/kissy/hilo/view/Text.min.js | 4 +- build/kissy/hilo/view/View.js | 154 +- build/kissy/hilo/view/View.min.js | 2 +- build/physics/physics.js | 7 +- build/physics/physics.min.js | 8 +- build/standalone/hilo-standalone.js | 2294 +++++++++-------- build/standalone/hilo-standalone.min.js | 8 +- build/standalone/hilo-standalone.zip | Bin 179766 -> 175875 bytes build/standalone/hilo/core/Class.js | 41 +- build/standalone/hilo/core/Class.min.js | 2 +- build/standalone/hilo/core/Hilo.js | 128 +- build/standalone/hilo/core/Hilo.min.js | 4 +- build/standalone/hilo/event/EventMixin.js | 56 +- build/standalone/hilo/event/EventMixin.min.js | 4 +- build/standalone/hilo/game/Camera.js | 35 +- build/standalone/hilo/game/Camera.min.js | 2 +- build/standalone/hilo/game/Camera3d.js | 109 +- build/standalone/hilo/game/Camera3d.min.js | 4 +- build/standalone/hilo/game/ParticleSystem.js | 113 +- .../hilo/game/ParticleSystem.min.js | 2 +- build/standalone/hilo/geom/Matrix.js | 75 +- build/standalone/hilo/geom/Matrix.min.js | 4 +- build/standalone/hilo/loader/ImageLoader.js | 11 +- .../standalone/hilo/loader/ImageLoader.min.js | 2 +- build/standalone/hilo/loader/LoadQueue.js | 73 +- build/standalone/hilo/loader/LoadQueue.min.js | 2 +- build/standalone/hilo/loader/ScriptLoader.js | 11 +- .../hilo/loader/ScriptLoader.min.js | 2 +- build/standalone/hilo/media/HTMLAudio.js | 59 +- build/standalone/hilo/media/HTMLAudio.min.js | 2 +- build/standalone/hilo/media/WebAudio.js | 81 +- build/standalone/hilo/media/WebAudio.min.js | 2 +- build/standalone/hilo/media/WebSound.js | 29 +- build/standalone/hilo/media/WebSound.min.js | 2 +- .../hilo/renderer/CanvasRenderer.js | 17 +- .../hilo/renderer/CanvasRenderer.min.js | 4 +- build/standalone/hilo/renderer/DOMRenderer.js | 22 +- .../hilo/renderer/DOMRenderer.min.js | 2 +- build/standalone/hilo/renderer/Renderer.js | 63 +- .../standalone/hilo/renderer/Renderer.min.js | 2 +- .../standalone/hilo/renderer/WebGLRenderer.js | 46 +- .../hilo/renderer/WebGLRenderer.min.js | 4 +- build/standalone/hilo/tween/Ease.js | 44 +- build/standalone/hilo/tween/Ease.min.js | 2 +- build/standalone/hilo/tween/Tween.js | 153 +- build/standalone/hilo/tween/Tween.min.js | 2 +- build/standalone/hilo/util/TextureAtlas.js | 36 +- .../standalone/hilo/util/TextureAtlas.min.js | 2 +- build/standalone/hilo/util/Ticker.js | 40 +- build/standalone/hilo/util/Ticker.min.js | 2 +- build/standalone/hilo/util/drag.js | 21 +- build/standalone/hilo/util/drag.min.js | 2 +- build/standalone/hilo/util/polyfill.js | 8 +- build/standalone/hilo/util/polyfill.min.js | 4 +- build/standalone/hilo/view/Bitmap.js | 36 +- build/standalone/hilo/view/Bitmap.min.js | 4 +- build/standalone/hilo/view/BitmapText.js | 54 +- build/standalone/hilo/view/BitmapText.min.js | 2 +- build/standalone/hilo/view/Button.js | 58 +- build/standalone/hilo/view/Button.min.js | 2 +- build/standalone/hilo/view/CacheMixin.js | 22 +- build/standalone/hilo/view/CacheMixin.min.js | 2 +- build/standalone/hilo/view/Container.js | 130 +- build/standalone/hilo/view/Container.min.js | 2 +- build/standalone/hilo/view/DOMElement.js | 31 +- build/standalone/hilo/view/DOMElement.min.js | 4 +- build/standalone/hilo/view/Drawable.js | 29 +- build/standalone/hilo/view/Drawable.min.js | 2 +- build/standalone/hilo/view/Graphics.js | 262 +- build/standalone/hilo/view/Graphics.min.js | 2 +- build/standalone/hilo/view/Sprite.js | 108 +- build/standalone/hilo/view/Sprite.min.js | 4 +- build/standalone/hilo/view/Stage.js | 78 +- build/standalone/hilo/view/Stage.min.js | 4 +- build/standalone/hilo/view/Text.js | 61 +- build/standalone/hilo/view/Text.min.js | 4 +- build/standalone/hilo/view/View.js | 154 +- build/standalone/hilo/view/View.min.js | 2 +- docs/api-en/code/core/Class.js | 22 +- docs/api-en/code/core/Hilo.js | 25 +- docs/api-en/code/event/EventMixin.js | 10 +- docs/api-en/code/game/Camera.js | 6 +- docs/api-en/code/game/Camera3d.js | 16 +- docs/api-en/code/game/ParticleSystem.js | 24 +- docs/api-en/code/geom/Matrix.js | 16 +- docs/api-en/code/loader/ImageLoader.js | 2 +- docs/api-en/code/loader/LoadQueue.js | 26 +- docs/api-en/code/loader/ScriptLoader.js | 2 +- docs/api-en/code/media/HTMLAudio.js | 22 +- docs/api-en/code/media/WebAudio.js | 34 +- docs/api-en/code/media/WebSound.js | 10 +- docs/api-en/code/renderer/CanvasRenderer.js | 2 +- docs/api-en/code/renderer/DOMRenderer.js | 4 +- docs/api-en/code/renderer/Renderer.js | 18 +- docs/api-en/code/renderer/WebGLRenderer.js | 10 +- docs/api-en/code/tween/Ease.js | 24 +- docs/api-en/code/tween/Tween.js | 36 +- docs/api-en/code/util/TextureAtlas.js | 12 +- docs/api-en/code/util/Ticker.js | 16 +- docs/api-en/code/util/drag.js | 6 +- docs/api-en/code/view/Bitmap.js | 4 +- docs/api-en/code/view/BitmapText.js | 10 +- docs/api-en/code/view/Button.js | 16 +- docs/api-en/code/view/CacheMixin.js | 8 +- docs/api-en/code/view/Container.js | 38 +- docs/api-en/code/view/DOMElement.js | 6 +- docs/api-en/code/view/Drawable.js | 6 +- docs/api-en/code/view/Graphics.js | 46 +- docs/api-en/code/view/Sprite.js | 26 +- docs/api-en/code/view/Stage.js | 16 +- docs/api-en/code/view/Text.js | 12 +- docs/api-en/code/view/View.js | 36 +- docs/api-en/index.html | 4 +- docs/api-en/symbols/Bitmap.html | 34 +- docs/api-en/symbols/BitmapText.html | 73 +- docs/api-en/symbols/Button.html | 59 +- docs/api-en/symbols/CacheMixin.html | 12 +- docs/api-en/symbols/Camera.html | 8 +- docs/api-en/symbols/Camera3d.html | 28 +- docs/api-en/symbols/CanvasRenderer.html | 16 +- docs/api-en/symbols/Class.html | 41 +- docs/api-en/symbols/Container.html | 86 +- docs/api-en/symbols/DOMElement.html | 40 +- docs/api-en/symbols/DOMRenderer.html | 16 +- docs/api-en/symbols/Drawable.html | 8 +- docs/api-en/symbols/Ease.html | 44 +- docs/api-en/symbols/EventMixin.html | 12 +- docs/api-en/symbols/Graphics.html | 105 +- docs/api-en/symbols/HTMLAudio.html | 33 +- docs/api-en/symbols/Hilo.html | 71 +- docs/api-en/symbols/LoadQueue.html | 28 +- docs/api-en/symbols/Matrix.html | 28 +- docs/api-en/symbols/ParticleSystem.html | 19 +- docs/api-en/symbols/Renderer.html | 32 +- docs/api-en/symbols/Sprite.html | 65 +- docs/api-en/symbols/Stage.html | 82 +- docs/api-en/symbols/Text.html | 33 +- docs/api-en/symbols/TextureAtlas.html | 12 +- docs/api-en/symbols/Ticker.html | 28 +- docs/api-en/symbols/Tween.html | 77 +- docs/api-en/symbols/View.html | 45 +- docs/api-en/symbols/WebAudio.html | 40 +- docs/api-en/symbols/WebGLRenderer.html | 28 +- docs/api-en/symbols/WebSound.html | 27 +- docs/api-en/symbols/drag.html | 17 +- .../src/docs_api-en_code_core_Class.js.html | 250 +- .../src/docs_api-en_code_core_Hilo.js.html | 713 ++--- .../docs_api-en_code_event_EventMixin.js.html | 10 +- .../src/docs_api-en_code_game_Camera.js.html | 6 +- .../docs_api-en_code_game_Camera3d.js.html | 16 +- ...cs_api-en_code_game_ParticleSystem.js.html | 24 +- .../src/docs_api-en_code_geom_Matrix.js.html | 16 +- ...ocs_api-en_code_loader_ImageLoader.js.html | 2 +- .../docs_api-en_code_loader_LoadQueue.js.html | 26 +- ...cs_api-en_code_loader_ScriptLoader.js.html | 2 +- .../docs_api-en_code_media_HTMLAudio.js.html | 22 +- .../docs_api-en_code_media_WebAudio.js.html | 34 +- .../docs_api-en_code_media_WebSound.js.html | 10 +- ...pi-en_code_renderer_CanvasRenderer.js.html | 2 +- ...s_api-en_code_renderer_DOMRenderer.js.html | 4 +- ...docs_api-en_code_renderer_Renderer.js.html | 18 +- ...api-en_code_renderer_WebGLRenderer.js.html | 10 +- .../src/docs_api-en_code_tween_Ease.js.html | 24 +- .../src/docs_api-en_code_tween_Tween.js.html | 36 +- ...docs_api-en_code_util_TextureAtlas.js.html | 12 +- .../src/docs_api-en_code_util_Ticker.js.html | 16 +- .../src/docs_api-en_code_util_drag.js.html | 6 +- .../src/docs_api-en_code_view_Bitmap.js.html | 4 +- .../docs_api-en_code_view_BitmapText.js.html | 10 +- .../src/docs_api-en_code_view_Button.js.html | 16 +- .../docs_api-en_code_view_CacheMixin.js.html | 8 +- .../docs_api-en_code_view_Container.js.html | 38 +- .../docs_api-en_code_view_DOMElement.js.html | 6 +- .../docs_api-en_code_view_Drawable.js.html | 6 +- .../docs_api-en_code_view_Graphics.js.html | 46 +- .../src/docs_api-en_code_view_Sprite.js.html | 26 +- .../src/docs_api-en_code_view_Stage.js.html | 16 +- .../src/docs_api-en_code_view_Text.js.html | 12 +- .../src/docs_api-en_code_view_View.js.html | 36 +- docs/api-zh/code/core/Class.js | 8 +- docs/api-zh/code/core/Hilo.js | 25 +- docs/api-zh/code/event/EventMixin.js | 10 +- docs/api-zh/code/game/Camera.js | 6 +- docs/api-zh/code/game/Camera3d.js | 16 +- docs/api-zh/code/game/ParticleSystem.js | 24 +- docs/api-zh/code/geom/Matrix.js | 16 +- docs/api-zh/code/loader/ImageLoader.js | 2 +- docs/api-zh/code/loader/LoadQueue.js | 26 +- docs/api-zh/code/loader/ScriptLoader.js | 2 +- docs/api-zh/code/media/HTMLAudio.js | 22 +- docs/api-zh/code/media/WebAudio.js | 34 +- docs/api-zh/code/media/WebSound.js | 10 +- docs/api-zh/code/renderer/CanvasRenderer.js | 2 +- docs/api-zh/code/renderer/DOMRenderer.js | 4 +- docs/api-zh/code/renderer/Renderer.js | 18 +- docs/api-zh/code/renderer/WebGLRenderer.js | 10 +- docs/api-zh/code/tween/Ease.js | 24 +- docs/api-zh/code/tween/Tween.js | 36 +- docs/api-zh/code/util/TextureAtlas.js | 12 +- docs/api-zh/code/util/Ticker.js | 16 +- docs/api-zh/code/util/drag.js | 6 +- docs/api-zh/code/view/Bitmap.js | 4 +- docs/api-zh/code/view/BitmapText.js | 10 +- docs/api-zh/code/view/Button.js | 16 +- docs/api-zh/code/view/CacheMixin.js | 8 +- docs/api-zh/code/view/Container.js | 38 +- docs/api-zh/code/view/DOMElement.js | 6 +- docs/api-zh/code/view/Drawable.js | 6 +- docs/api-zh/code/view/Graphics.js | 46 +- docs/api-zh/code/view/Sprite.js | 26 +- docs/api-zh/code/view/Stage.js | 16 +- docs/api-zh/code/view/Text.js | 12 +- docs/api-zh/code/view/View.js | 36 +- docs/api-zh/index.html | 2 +- docs/api-zh/symbols/Bitmap.html | 35 +- docs/api-zh/symbols/BitmapText.html | 74 +- docs/api-zh/symbols/Button.html | 60 +- docs/api-zh/symbols/CacheMixin.html | 12 +- docs/api-zh/symbols/Camera.html | 8 +- docs/api-zh/symbols/Camera3d.html | 28 +- docs/api-zh/symbols/CanvasRenderer.html | 16 +- docs/api-zh/symbols/Class.html | 31 +- docs/api-zh/symbols/Container.html | 87 +- docs/api-zh/symbols/DOMElement.html | 41 +- docs/api-zh/symbols/DOMRenderer.html | 16 +- docs/api-zh/symbols/Drawable.html | 8 +- docs/api-zh/symbols/Ease.html | 44 +- docs/api-zh/symbols/EventMixin.html | 12 +- docs/api-zh/symbols/Graphics.html | 110 +- docs/api-zh/symbols/HTMLAudio.html | 34 +- docs/api-zh/symbols/Hilo.html | 90 +- docs/api-zh/symbols/LoadQueue.html | 28 +- docs/api-zh/symbols/Matrix.html | 28 +- docs/api-zh/symbols/ParticleSystem.html | 19 +- docs/api-zh/symbols/Renderer.html | 32 +- docs/api-zh/symbols/Sprite.html | 66 +- docs/api-zh/symbols/Stage.html | 83 +- docs/api-zh/symbols/Text.html | 34 +- docs/api-zh/symbols/TextureAtlas.html | 12 +- docs/api-zh/symbols/Ticker.html | 28 +- docs/api-zh/symbols/Tween.html | 77 +- docs/api-zh/symbols/View.html | 46 +- docs/api-zh/symbols/WebAudio.html | 40 +- docs/api-zh/symbols/WebGLRenderer.html | 28 +- docs/api-zh/symbols/WebSound.html | 27 +- docs/api-zh/symbols/drag.html | 17 +- .../src/docs_api-zh_code_core_Class.js.html | 236 +- .../src/docs_api-zh_code_core_Hilo.js.html | 713 ++--- .../docs_api-zh_code_event_EventMixin.js.html | 10 +- .../src/docs_api-zh_code_game_Camera.js.html | 6 +- .../docs_api-zh_code_game_Camera3d.js.html | 16 +- ...cs_api-zh_code_game_ParticleSystem.js.html | 24 +- .../src/docs_api-zh_code_geom_Matrix.js.html | 16 +- ...ocs_api-zh_code_loader_ImageLoader.js.html | 2 +- .../docs_api-zh_code_loader_LoadQueue.js.html | 26 +- ...cs_api-zh_code_loader_ScriptLoader.js.html | 2 +- .../docs_api-zh_code_media_HTMLAudio.js.html | 22 +- .../docs_api-zh_code_media_WebAudio.js.html | 34 +- .../docs_api-zh_code_media_WebSound.js.html | 10 +- ...pi-zh_code_renderer_CanvasRenderer.js.html | 2 +- ...s_api-zh_code_renderer_DOMRenderer.js.html | 4 +- ...docs_api-zh_code_renderer_Renderer.js.html | 18 +- ...api-zh_code_renderer_WebGLRenderer.js.html | 10 +- .../src/docs_api-zh_code_tween_Ease.js.html | 24 +- .../src/docs_api-zh_code_tween_Tween.js.html | 36 +- ...docs_api-zh_code_util_TextureAtlas.js.html | 12 +- .../src/docs_api-zh_code_util_Ticker.js.html | 16 +- .../src/docs_api-zh_code_util_drag.js.html | 6 +- .../src/docs_api-zh_code_view_Bitmap.js.html | 4 +- .../docs_api-zh_code_view_BitmapText.js.html | 10 +- .../src/docs_api-zh_code_view_Button.js.html | 16 +- .../docs_api-zh_code_view_CacheMixin.js.html | 8 +- .../docs_api-zh_code_view_Container.js.html | 38 +- .../docs_api-zh_code_view_DOMElement.js.html | 6 +- .../docs_api-zh_code_view_Drawable.js.html | 6 +- .../docs_api-zh_code_view_Graphics.js.html | 46 +- .../src/docs_api-zh_code_view_Sprite.js.html | 26 +- .../src/docs_api-zh_code_view_Stage.js.html | 16 +- .../src/docs_api-zh_code_view_Text.js.html | 12 +- .../src/docs_api-zh_code_view_View.js.html | 36 +- package.json | 2 +- 574 files changed, 14511 insertions(+), 13296 deletions(-) create mode 100644 CHANGELOG.md delete mode 100644 Changelog.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..5b0c8961 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,30 @@ + +## [1.0.1](https://github.com/hiloteam/hilo/compare/v1.0.0...v1.0.1) (2016-05-18) + + +### Bug Fixes + +* Bitmap.setImage need set width&height ([7806046](https://github.com/hiloteam/hilo/commit/7806046)) +* eventMixin.on once bug ([fcaebfd](https://github.com/hiloteam/hilo/commit/fcaebfd)) +* Hilo.getElementRect bug ([d1dda4a](https://github.com/hiloteam/hilo/commit/d1dda4a)) +* Hilo.getElementRect bug ([ead92ae](https://github.com/hiloteam/hilo/commit/ead92ae)) +* set DOMElement pointer-event style to visible when it's pointerEnabled is true ([fa28684](https://github.com/hiloteam/hilo/commit/fa28684)) +* Text.js len & wlen are used before there were defined ([7268ea4](https://github.com/hiloteam/hilo/commit/7268ea4)) + + +### Features + +* change WebGLRenderer.isSupport() to WebGLRenderer.isSupported ([f9f9bc4](https://github.com/hiloteam/hilo/commit/f9f9bc4)) + + + + +# [1.0.0](https://github.com/hiloteam/hilo/compare/4efc6e6...v1.0.0) (2016-03-01) + + +### Bug Fixes + +* WebGLRenderer worldMatrix bug ([4efc6e6](https://github.com/hiloteam/hilo/commit/4efc6e6)) + + + diff --git a/Changelog.md b/Changelog.md deleted file mode 100644 index 0fb365db..00000000 --- a/Changelog.md +++ /dev/null @@ -1,2 +0,0 @@ -Changelog -========= \ No newline at end of file diff --git a/build/amd/hilo-amd.js b/build/amd/hilo-amd.js index 208aa8a4..07b7aa85 100644 --- a/build/amd/hilo-amd.js +++ b/build/amd/hilo-amd.js @@ -1,18 +1,16 @@ /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/core/Hilo', function(){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + + /** - * @namespace Hilo的基础核心方法集合。 + * @language=en + * @namespace Hilo The underlying core set of methods. * @static * @module hilo/core/Hilo */ @@ -23,9 +21,10 @@ var win = window, doc = document, docElem = doc.documentElement, return { /** - * 获取一个全局唯一的id。如Stage1,Bitmap2等。 - * @param {String} prefix 生成id的前缀。 - * @returns {String} 全局唯一id。 + * @language=en + * Gets a globally unique id. Such as Stage1, Bitmap2 etc. + * @param {String} prefix Generated id's prefix. + * @returns {String} Globally unique id. */ getUid: function(prefix){ var id = ++uid; @@ -38,9 +37,10 @@ return { }, /** - * 为指定的可视对象生成一个包含路径的字符串表示形式。如Stage1.Container2.Bitmap3。 - * @param {View} view 指定的可视对象。 - * @returns {String} 可视对象的字符串表示形式。 + * @language=en + * Generates a string representation that contains a path to the specified visual object. Such as Stage1.Container2.Bitmap3. + * @param {View} view Specified visual object. + * @returns {String} String representation of the visual object. */ viewToString: function(view){ var result, obj = view; @@ -52,11 +52,12 @@ return { }, /** - * 简单的浅复制对象。 - * @param {Object} target 要复制的目标对象。 - * @param {Object} source 要复制的源对象。 - * @param {Boolean} strict 指示是否复制未定义的属性,默认为false,即不复制未定义的属性。 - * @returns {Object} 复制后的对象。 + * @language=en + * Simple shallow copy objects. + * @param {Object} target Target object to copy to. + * @param {Object} source Source object to copy. + * @param {Boolean} strict Indicates whether replication is undefined property, default is false, i.e., undefined attributes are not copied. + * @returns {Object} Object after copying. */ copy: function(target, source, strict){ for(var key in source){ @@ -68,15 +69,16 @@ return { }, /** - * 浏览器特性集合。包括: + * @language=en + * Browser feature set includes: * */ browser: (function(){ @@ -134,11 +136,12 @@ return { })(), /** - * 事件类型枚举对象。包括: + * @language=en + * Event enumeration objects include: * */ event: (function(){ @@ -151,17 +154,18 @@ return { })(), /** - * 可视对象对齐方式枚举对象。包括: + * @language=en + * Visual object alinment enumeration objects include: * */ align: { @@ -177,16 +181,17 @@ return { }, /** - * 获取DOM元素在页面中的内容显示区域。 - * @param {HTMLElement} elem DOM元素。 - * @returns {Object} DOM元素的可视区域。格式为:{left:0, top:0, width:100, height:100}。 + * @language=en + * Get DOM element content in the page display area. + * @param {HTMLElement} elem DOM elements. + * @returns {Object} Viewable area DOM elements. Format is: {left:0, top:0, width:100, height:100}. */ getElementRect: function(elem){ try{ //this fails if it's a disconnected DOM node var bounds = elem.getBoundingClientRect(); }catch(e){ - bounds = {top:elem.offsetTop, left:elem.offsetLeft, width:elem.offsetWidth, height:elem.offsetHeight}; + bounds = {top:elem.offsetTop, left:elem.offsetLeft, right:elem.offsetLeft + elem.offsetWidth, bottom:elem.offsetTop + elem.offsetHeight}; } var offsetX = ((win.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)) || 0; @@ -198,22 +203,26 @@ return { var padTop = (parseIntFn(styles.paddingTop) + parseIntFn(styles.borderTopWidth)) || 0; var padRight = (parseIntFn(styles.paddingRight) + parseIntFn(styles.borderRightWidth)) || 0; var padBottom = (parseIntFn(styles.paddingBottom) + parseIntFn(styles.borderBottomWidth)) || 0; + var top = bounds.top || 0; var left = bounds.left || 0; + var right = bounds.right || 0; + var bottom = bounds.bottom || 0; return { left: left + offsetX + padLeft, top: top + offsetY + padTop, - width: bounds.right - padRight - left - padLeft, - height: bounds.bottom - padBottom - top - padTop + width: right - padRight - left - padLeft, + height: bottom - padBottom - top - padTop }; }, /** - * 创建一个DOM元素。可指定属性和样式。 - * @param {String} type 要创建的DOM元素的类型。比如:'div'。 - * @param {Object} properties 指定DOM元素的属性和样式。 - * @returns {HTMLElement} 一个DOM元素。 + * @language=en + * Create a DOM element. You can specify properties and styles. + * @param {String} type DOM element type to be created. Such as: 'div'. + * @param {Object} properties Properties and styles for DOM element. + * @returns {HTMLElement} A DOM element. */ createElement: function(type, properties){ var elem = doc.createElement(type), p, val, s; @@ -229,17 +238,19 @@ return { }, /** - * 根据参数id获取一个DOM元素。此方法等价于document.getElementById(id)。 - * @param {String} id 要获取的DOM元素的id。 - * @returns {HTMLElement} 一个DOM元素。 + * @language=en + * Gets a DOM element according to the parameter id. This method is equivalent to document.getElementById(id). + * @param {String} id id of the DOM element you want to get. + * @returns {HTMLElement} A DOM element. */ getElement: function(id){ return doc.getElementById(id); }, /** - * 设置可视对象DOM元素的CSS样式。 - * @param {View} obj 指定要设置CSS样式的可视对象。 + * @language=en + * Set visual object DOM element CSS style. + * @param {View} obj Specifies the CSS style to set the visual object. * @private */ setElementStyleByView: function(obj){ @@ -337,9 +348,10 @@ return { }, /** - * 生成可视对象的CSS变换样式。 - * @param {View} obj 指定生成CSS变换样式的可视对象。 - * @returns {String} 生成的CSS样式字符串。 + * @language=en + * Generated visual object CSS style transformation. + * @param {View} obj Specifies visual object whose CSS style must be got. + * @returns {String} String representation of the CSS style. */ getTransformCSS: function(obj){ var use3d = this.browser.supportTransform3D, @@ -357,20 +369,17 @@ return Hilo; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/core/Class', function(){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * 创建类示例: + * @language=en + * Create Example Class: *
  * var Bird = Hilo.Class.create({
  *     Extends: Animal,
@@ -392,23 +401,24 @@ define('hilo/core/Class', function(){
  * swallow.fly();
  * Bird.isBird(swallow);
  * 
- * @namespace Class是提供类的创建的辅助工具。 + * @namespace Class Class is created to aid the developer. * @static * @module hilo/core/Class */ var Class = (function(){ /** - * 根据参数指定的属性和方法创建类。 - * @param {Object} properties 要创建的类的相关属性和方法。主要有: + * @language=en + * Create a class based on the parameters, properties and methods specified. + * @param {Object} properties Properties and methods to create the class. * - * @returns {Object} 创建的类。 + * @returns {Object} Create classes. */ var create = function(properties){ properties = properties || {}; @@ -418,6 +428,7 @@ var create = function(properties){ } /** + * @language=en * @private */ var implement = function(properties){ @@ -464,6 +475,7 @@ var classMutators = /** @ignore */{ }; /** + * @language=en * @private */ var createProto = (function(){ @@ -481,10 +493,11 @@ var createProto = (function(){ })(); /** - * 混入属性或方法。 - * @param {Object} target 混入目标对象。 - * @param {Object} source 要混入的属性和方法来源。可支持多个来源参数。 - * @returns {Object} 混入目标对象。 + * @language=en + * Mixed property or method. + * @param {Object} target Mixed audiences. + * @param {Object} source The source whose methods and properties are to be mixed. It can support multiple source parameters. + * @returns {Object} Mixed audiences. */ var mix = function(target){ for(var i = 1, len = arguments.length; i < len; i++){ @@ -538,26 +551,23 @@ return Class; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/geom/Matrix', ['hilo/core/Class'], function(Class){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * @class Matrix类表示一个转换矩阵,它确定如何将点从一个坐标空间映射到另一个坐标空间。 - * @param {Number} a 缩放或旋转图像时影响像素沿 x 轴定位的值。 - * @param {Number} b 旋转或倾斜图像时影响像素沿 y 轴定位的值。 - * @param {Number} c 旋转或倾斜图像时影响像素沿 x 轴定位的值。 - * @param {Number} d 缩放或旋转图像时影响像素沿 y 轴定位的值。 - * @param {Number} tx 沿 x 轴平移每个点的距离。 - * @param {Number} ty 沿 y 轴平移每个点的距离。 + * @language=en + * @class Matrix class is a transforming matrix, which declare how points in one coordinate maped to another coordinate. + * @param {Number} a The value affects pixel positioning alongside the x axis when Scale or rotate images. + * @param {Number} b The value affects pixel positioning alongside the y axis when rotate or skew images. + * @param {Number} c The value affects pixel positioning alongside the x axis when rotate or skew images. + * @param {Number} d The value affects pixel positioning alongside the y axis when Scale or rotate images. + * @param {Number} tx The distance to move every point alongside the x axis. + * @param {Number} ty The distance to move every point alongside the y axis. * @module hilo/geom/Matrix * @requires hilo/core/Class */ @@ -572,9 +582,10 @@ var Matrix = Class.create(/** @lends Matrix.prototype */{ }, /** - * 将某个矩阵与当前矩阵连接,从而将这两个矩阵的几何效果有效地结合在一起。 - * @param {Matrix} mtx 要连接到源矩阵的矩阵。 - * @returns {Matrix} 一个Matrix对象。 + * @language=en + * Link a Matrix to current Matrix, in order to make geometry effects on these two composed more effective. + * @param {Matrix} mtx Matrix that link to the source matrix. + * @returns {Matrix} A Matrix Object. */ concat: function(mtx){ var args = arguments, @@ -603,9 +614,10 @@ var Matrix = Class.create(/** @lends Matrix.prototype */{ }, /** - * 对 Matrix 对象应用旋转转换。 - * @param {Number} angle 旋转的角度。 - * @returns {Matrix} 一个Matrix对象。 + * @language=en + * Rotate the Matrix Object. + * @param {Number} angle The angle to rotate. + * @returns {Matrix} A Matrix object. */ rotate: function(angle){ var sin = Math.sin(angle), cos = Math.cos(angle), @@ -622,10 +634,11 @@ var Matrix = Class.create(/** @lends Matrix.prototype */{ }, /** - * 对矩阵应用缩放转换。 - * @param {Number} sx 用于沿 x 轴缩放对象的乘数。 - * @param {Number} sy 用于沿 y 轴缩放对象的乘数。 - * @returns {Matrix} 一个Matrix对象。 + * @language=en + * Scale the Matrix. + * @param {Number} sx The value to multiply those object scale alongside the x axis. + * @param {Number} sy The value to multiply those object scale alongside the y axis. + * @returns {Matrix} A Matrix object. */ scale: function(sx, sy){ this.a *= sx; @@ -638,10 +651,11 @@ var Matrix = Class.create(/** @lends Matrix.prototype */{ }, /** - * 沿 x 和 y 轴平移矩阵,由 dx 和 dy 参数指定。 - * @param {Number} dx 沿 x 轴向右移动的量(以像素为单位)。 - * @param {Number} dy 沿 y 轴向右移动的量(以像素为单位)。 - * @returns {Matrix} 一个Matrix对象。 + * @language=en + * Translate the Matrix alongside x axis and y axis by dx and dy. + * @param {Number} dx Translate Matrix alongside the x axis to the right (measured in px). + * @param {Number} dy Translate Matrix alongside the y axis to the right (measured in px). + * @returns {Matrix} A Matrix object. */ translate: function(dx, dy){ this.tx += dx; @@ -650,8 +664,9 @@ var Matrix = Class.create(/** @lends Matrix.prototype */{ }, /** - * 为每个矩阵属性设置一个值,该值将导致 null 转换。通过应用恒等矩阵转换的对象将与原始对象完全相同。 - * @returns {Matrix} 一个Matrix对象。 + * @language=en + * Set each Matrix property a value to trigger null transform. The Matrix after applying identity matrix transformation will be exactly the same as original. + * @returns {Matrix} A Matrix object. */ identity: function(){ this.a = this.d = 1; @@ -660,8 +675,9 @@ var Matrix = Class.create(/** @lends Matrix.prototype */{ }, /** - * 执行原始矩阵的逆转换。您可以将一个逆矩阵应用于对象来撤消在应用原始矩阵时执行的转换。 - * @returns {Matrix} 一个Matrix对象。 + * @language=en + * Apply an invert transformation of original Matrix. Using this invert transformation, you can reset a Matrix to a state before it had been apply some Matrix. + * @returns {Matrix} A Matrix object. */ invert: function(){ var a = this.a; @@ -681,10 +697,11 @@ var Matrix = Class.create(/** @lends Matrix.prototype */{ }, /** - * 返回将 Matrix 对象表示的几何转换应用于指定点所产生的结果。 - * @param {Object} point 想要获得其矩阵转换结果的点。 - * @param {Boolean} round 是否对点的坐标进行向上取整。 - * @param {Boolean} returnNew 是否返回一个新的点。 + * @language=en + * Return the result after apply a Matrix displaying transform on the point. + * @param {Object} point Point need to transform. + * @param {Boolean} round Whether ceil the coordinate values of the point. + * @param {Boolean} returnNew Whether return a new point. * @returns {Object} 由应用矩阵转换所产生的点。 */ transformPoint: function(point, round, returnNew){ @@ -703,24 +720,22 @@ var Matrix = Class.create(/** @lends Matrix.prototype */{ }); + return Matrix; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/event/EventMixin', ['hilo/core/Class'], function(Class){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * @class EventMixin是一个包含事件相关功能的mixin。可以通过 Class.mix(target, EventMixin) 来为target增加事件功能。 + * @language=en + * @class EventMixin is a mixin on event related functions. Use Class.mix(target, EventMixin) to add event function onto target. * @mixin * @static * @module hilo/event/EventMixin @@ -730,11 +745,12 @@ var EventMixin = { _listeners: null, /** - * 增加一个事件监听。 - * @param {String} type 要监听的事件类型。 - * @param {Function} listener 事件监听回调函数。 - * @param {Boolean} once 是否是一次性监听,即回调函数响应一次后即删除,不再响应。 - * @returns {Object} 对象本身。链式调用支持。 + * @language=en + * Add an event listenser. + * @param {String} type Event type to listen. + * @param {Function} listener Callback function of event listening. + * @param {Boolean} once Listen on event only once and no more response after the first response? + * @returns {Object} The Event itself. Functions chain call supported. */ on: function(type, listener, once){ var listeners = (this._listeners = this._listeners || {}); @@ -748,10 +764,11 @@ var EventMixin = { }, /** - * 删除一个事件监听。如果不传入任何参数,则删除所有的事件监听;如果不传入第二个参数,则删除指定类型的所有事件监听。 - * @param {String} type 要删除监听的事件类型。 - * @param {Function} listener 要删除监听的回调函数。 - * @returns {Object} 对象本身。链式调用支持。 + * @language=en + * Remove one event listener. Remove all event listeners if no parameter provided, and remove all event listeners on one type which is provided as the only parameter. + * @param {String} type The type of event listener that want to remove. + * @param {Function} listener Event listener callback function to be removed. + * @returns {Object} The Event itself. Functions chain call supported. */ off: function(type, listener){ //remove all event listeners @@ -781,10 +798,11 @@ var EventMixin = { }, /** - * 发送事件。当第一个参数类型为Object时,则把它作为一个整体事件对象。 - * @param {String} type 要发送的事件类型。 - * @param {Object} detail 要发送的事件的具体信息,即事件随带参数。 - * @returns {Boolean} 是否成功调度事件。 + * @language=en + * Send events. If the first parameter is an Object, take it as an Event Object. + * @param {String} type Event type to send. + * @param {Object} detail The detail (parameters go with the event) of Event to send. + * @returns {Boolean} Whether Event call successfully. */ fire: function(type, detail){ var event, eventType; @@ -800,14 +818,19 @@ var EventMixin = { var eventListeners = listeners[eventType]; if(eventListeners){ - eventListeners = eventListeners.slice(0); + var eventListenersCopy = eventListeners.slice(0); event = event || new EventObject(eventType, this, detail); if(event._stopped) return false; - for(var i = 0; i < eventListeners.length; i++){ - var el = eventListeners[i]; + for(var i = 0; i < eventListenersCopy.length; i++){ + var el = eventListenersCopy[i]; el.listener.call(this, event); - if(el.once) eventListeners.splice(i--, 1); + if(el.once) { + var index = eventListeners.indexOf(el); + if(index > -1){ + eventListeners.splice(index, 1); + } + } } if(eventListeners.length == 0) delete listeners[eventType]; @@ -818,7 +841,8 @@ var EventMixin = { }; /** - * 事件对象类。当前仅为内部类,以后有需求的话可能会考虑独立为公开类。 + * @language=en + * Event Object class. It's an private class now, but maybe will become a public class if needed. */ var EventObject = Class.create({ constructor: function EventObject(type, target, detail){ @@ -854,26 +878,23 @@ return EventMixin; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/Drawable', ['hilo/core/Hilo', 'hilo/core/Class'], function(Hilo, Class){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * @class Drawable是可绘制图像的包装。 - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @language=en + * @class Drawable is a wrapper of drawable images. + * @param {Object} properties create Objects properties, contains all writable properties. * @module hilo/view/Drawable * @requires hilo/core/Hilo * @requires hilo/core/Class - * @property {Object} image 要绘制的图像。即可被CanvasRenderingContext2D.drawImage使用的对象类型,可以是HTMLImageElement、HTMLCanvasElement、HTMLVideoElement等对象。 - * @property {array} rect 要绘制的图像的矩形区域。 + * @property {Object} image Image to be drawed, can used by CanvasRenderingContext2D.drawImage,like HTMLImageElement、HTMLCanvasElement、HTMLVideoElement。 + * @property {array} rect The retangle area that image will be drawed. */ var Drawable = Class.create(/** @lends Drawable.prototype */{ constructor: function(properties){ @@ -884,8 +905,9 @@ var Drawable = Class.create(/** @lends Drawable.prototype */{ rect: null, /** - * 初始化可绘制对象。 - * @param {Object} properties 要初始化的属性。 + * @language=en + * Initialize drawable elements. + * @param {Object} properties Properties need to be initialized. */ init: function(properties){ var me = this, oldImage = me.image; @@ -917,9 +939,10 @@ var Drawable = Class.create(/** @lends Drawable.prototype */{ Statics: /** @lends Drawable */{ /** - * 判断参数elem指定的元素是否可包装成Drawable对象。 - * @param {Object} elem 要测试的对象。 - * @return {Boolean} 如果是可包装成Drawable对象则返回true,否则为false。 + * @language=en + * Check whether the given 'elem' and be wrapped into Drawable object. + * @param {Object} elem Element to be tested. + * @return {Boolean} Return true if element can be wrapped into Drawable element, otherwises return false. */ isDrawable: function(elem){ if(!elem || !elem.tagName) return false; @@ -933,27 +956,24 @@ return Drawable; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/renderer/Renderer', ['hilo/core/Hilo', 'hilo/core/Class'], function(Hilo, Class){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * @class 渲染器抽象基类。 - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @language=en + * @class Renderer Renderer is the base class of renderer. + * @param {Object} properties The properties to create a renderer, contains all writeable props of this class. * @module hilo/renderer/Renderer * @requires hilo/core/Hilo * @requires hilo/core/Class - * @property {Object} canvas 渲染器对应的画布。它可能是一个普通的DOM元素,比如div,也可以是一个canvas画布元素。只读属性。 - * @property {Object} stage 渲染器对应的舞台。只读属性。 - * @property {String} renderType 渲染方式。只读属性。 + * @property {Object} canvas The canvas of renderer. It can be a dom element, such as a div element, or a canvas element. readonly. + * @property {Object} stage The stage of renderer, readonly. + * @property {String} renderType The render type of renderer, readonly. */ var Renderer = Class.create(/** @lends Renderer.prototype */{ constructor: function(properties){ @@ -966,52 +986,60 @@ var Renderer = Class.create(/** @lends Renderer.prototype */{ stage: null, /** - * 为开始绘制可视对象做准备。需要子类来实现。 - * @param {View} target 要绘制的可视对象。 + * @language=en + * Prepare for draw visual object. The subclass need to implement it. + * @param {View} target The visual target to draw. */ startDraw: function(target){ }, /** - * 绘制可视对象。需要子类来实现。 - * @param {View} target 要绘制的可视对象。 + * @language=en + * Draw the visual object. The subclass need to implement it. + * @param {View} target The visual target to draw. */ draw: function(target){ }, /** - * 结束绘制可视对象后的后续处理方法。需要子类来实现。 - * @param {View} target 要绘制的可视对象。 + * @language=en + * The handling method after draw the visual object. The subclass need to implement it. + * @param {View} target The visual target to draw. */ endDraw: function(target){ }, /** - * 对可视对象进行变换。需要子类来实现。 + * @language=en + * Transfrom the visual object. The subclass need to implement it. */ transform: function(){ }, /** - * 隐藏可视对象。需要子类来实现。 + * @language=en + * Hide the visual object. The subclass need to implement it. */ hide: function(){ }, /** - * 从画布中删除可视对象。注意:不是从stage中删除对象。需要子类来实现。 - * @param {View} target 要删除的可视对象。 + * @language=en + * Remove the visual object from canvas. Notice that it dosen't remove the object from stage. The subclass need to implement it. + * @param {View} target The visual target to remove. */ remove: function(target){ }, /** - * 清除画布指定区域。需要子类来实现。 - * @param {Number} x 指定区域的x轴坐标。 - * @param {Number} y 指定区域的y轴坐标。 - * @param {Number} width 指定区域的宽度。 - * @param {Number} height 指定区域的高度。 + * @language=en + * Clear the given region of canvas. The subclass need to implement it. + * @param {Number} x The position on the x axis of the given region. + * @param {Number} y The position on the y axis of the given region. + * @param {Number} width The width of the given region. + * @param {Number} height The height of the given region. */ clear: function(x, y, width, height){ }, /** - * 改变渲染器的画布大小。 - * @param {Number} width 指定渲染画布新的宽度。 - * @param {Number} height 指定渲染画布新的高度。 + * @language=en + * Resize the renderer's canvas. + * @param {Number} width The width of renderer's canvas. + * @param {Number} height The height of the renderer's canvas. */ resize: function(width, height){ } @@ -1021,27 +1049,24 @@ return Renderer; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/renderer/CanvasRenderer', ['hilo/core/Class', 'hilo/core/Hilo', 'hilo/renderer/Renderer'], function(Class, Hilo, Renderer){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * @class canvas画布渲染器。所有可视对象将渲染在canvas画布上。舞台Stage会根据参数canvas选择不同的渲染器,开发者无需直接使用此类。 + * @language=en + * @class CanvasRenderer CanvasRenderer, all the visual object is drawing on the canvas element.The stage will create different renderer depend on the canvas and renderType properties, developer need not use this class directly. * @augments Renderer - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @param {Object} properties The properties to create a renderer, contains all writeable props of this class. * @module hilo/renderer/CanvasRenderer * @requires hilo/core/Class * @requires hilo/core/Hilo * @requires hilo/renderer/Renderer - * @property {CanvasRenderingContext2D} context canvas画布的上下文。只读属性。 + * @property {CanvasRenderingContext2D} context The context of the canvas element, readonly. */ var CanvasRenderer = Class.create(/** @lends CanvasRenderer.prototype */{ Extends: Renderer, @@ -1086,7 +1111,7 @@ var CanvasRenderer = Class.create(/** @lends CanvasRenderer.prototype */{ var drawable = target.drawable, image = drawable && drawable.image; if(image){ var rect = drawable.rect, sw = rect[2], sh = rect[3], offsetX = rect[4], offsetY = rect[5]; - //ie9+浏览器宽高为0时会报错 + //ie9+浏览器宽高为0时会报错 fixed ie9 bug. if(!sw || !sh){ return; } @@ -1250,22 +1275,19 @@ return CanvasRenderer; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/renderer/DOMRenderer', ['hilo/core/Class', 'hilo/core/Hilo', 'hilo/renderer/Renderer', 'hilo/view/Drawable'], function(Class, Hilo, Renderer, Drawable){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * @class DOM+CSS3渲染器。将可视对象以DOM元素方式渲染出来。舞台Stage会根据参数canvas选择不同的渲染器,开发者无需直接使用此类。 + * @language=en + * @class DomRenderer The DomRenderer, all the visual object is drawing using dom element.The stage will create different renderer depend on the canvas and renderType properties, developer need not use this class directly. * @augments Renderer - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @param {Object} properties The properties to create a renderer, contains all writeable props of this class. * @module hilo/renderer/DOMRenderer * @requires hilo/core/Class * @requires hilo/core/Hilo @@ -1384,10 +1406,11 @@ return Class.create({ }); /** - * 创建一个可渲染的DOM,可指定tagName,如canvas或div。 - * @param {Object} view 一个可视对象或类似的对象。 - * @param {Object} imageObj 指定渲染的image及相关设置,如绘制区域rect。 - * @return {HTMLElement} 新创建的DOM对象。 + * @language=en + * Create a dom element, you can set the tagName property,such as canvas and div. + * @param {Object} view A visual object. + * @param {Object} imageObj The image object to render, include the image propertiy and other associated properties, such as rect. + * @return {HTMLElement} The created dom element. * @private */ function createDOMDrawable(view, imageObj){ @@ -1434,17 +1457,13 @@ return DOMRenderer; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/renderer/WebGLRenderer', ['hilo/core/Class', 'hilo/renderer/Renderer', 'hilo/geom/Matrix'], function(Class, Renderer, Matrix){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** * Heavily inspired by PIXI's SpriteRenderer: @@ -1453,33 +1472,37 @@ define('hilo/renderer/WebGLRenderer', ['hilo/core/Class', 'hilo/renderer/Rendere var DEG2RAD = Math.PI / 180; /** - * @class webgl画布渲染器。所有可视对象将渲染在canvas画布上。 + * @language=en + * @class WebGLRenderer The WebGLRenderer, all the visual object is drawing on the canvas using WebGL.The stage will create different renderer depend on the canvas and renderType properties, developer need not use this class directly. * @augments Renderer - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @param {Object} properties The properties to create a renderer, contains all writeable props of this class. * @module hilo/renderer/WebGLRenderer * @requires hilo/core/Class * @requires hilo/renderer/Renderer * @requires hilo/geom/Matrix - * @property {WebGLRenderingContext} gl webgl上下文。只读属性。 + * @property {WebGLRenderingContext} gl The WebGL context of the renderer, readonly. */ var WebGLRenderer = Class.create(/** @lends WebGLRenderer.prototype */{ Extends: Renderer, Statics:/** @lends WebGLRenderer */{ /** - * 最大批渲染数量。 + * @language=en + * The max num of batch draw, default is 2000. * @type {Number} */ MAX_BATCH_NUM:2000, /** - * 顶点属性数。只读属性。 + * @language=en + * The num of vertex attributes, readonly. * @type {Number} */ ATTRIBUTE_NUM:5, /** - * 是否支持WebGL。只读属性。 + * @language=en + * is WebGL supported, readonly. * @type {Boolean} */ - isSupport:null + isSupported:null }, renderType:'webgl', gl:null, @@ -1544,7 +1567,6 @@ var WebGLRenderer = Class.create(/** @lends WebGLRenderer.prototype */{ } return false; }, - /** * @private * @see Renderer#draw @@ -1835,6 +1857,7 @@ var WebGLRenderer = Class.create(/** @lends WebGLRenderer.prototype */{ }); /** + * @language=en * shader * @param {WebGLRenderer} renderer [description] * @param {Object} source @@ -1954,66 +1977,57 @@ Shader.prototype = { } }; -WebGLRenderer.isSupport = function(){ - if(this._isSupport !== undefined){ - return this._isSupport; +WebGLRenderer.isSupported = (function(){ + var canvas = document.createElement('canvas'); + if(canvas.getContext && (canvas.getContext('webgl')||canvas.getContext('experimental-webgl'))){ + return true; } else{ - var canvas = document.createElement('canvas'); - if(canvas.getContext && (canvas.getContext('webgl')||canvas.getContext('experimental-webgl'))){ - this._isSupport = true; - } - else{ - this._isSupport = false; - } - return this._isSupport; + return false; } -}; +})(); return WebGLRenderer; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/View', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/event/EventMixin', 'hilo/geom/Matrix'], function(Hilo, Class, EventMixin, Matrix){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * @class View类是所有可视对象或组件的基类。 - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @language=en + * @class View View is the base class of all display objects + * @param {Object} properties The properties to create a view object, contains all writeable props of this class * @module hilo/view/View * @requires hilo/core/Hilo * @requires hilo/core/Class * @requires hilo/event/EventMixin * @requires hilo/geom/Matrix - * @property {String} id 可视对象的唯一标识符。 - * @property {Number} x 可视对象的x轴坐标。默认值为0。 - * @property {Number} y 可视对象的y轴坐标。默认值为0。 - * @property {Number} width 可视对象的宽度。默认值为0。 - * @property {Number} height 可视对象的高度。默认值为0。 - * @property {Number} alpha 可视对象的透明度。默认值为1。 - * @property {Number} rotation 可视对象的旋转角度。默认值为0。 - * @property {Boolean} visible 可视对象是否可见。默认为可见,即true。 - * @property {Number} pivotX 可视对象的中心点的x轴坐标。默认值为0。 - * @property {Number} pivotY 可视对象的中心点的y轴坐标。默认值为0。 - * @property {Number} scaleX 可视对象在x轴上的缩放比例。默认为不缩放,即1。 - * @property {Number} scaleY 可视对象在y轴上的缩放比例。默认为不缩放,即1。 - * @property {Boolean} pointerEnabled 可视对象是否接受交互事件。默认为接受交互事件,即true。 - * @property {Object} background 可视对象的背景样式。可以是CSS颜色值、canvas的gradient或pattern填充。 - * @property {Graphics} mask 可视对象的遮罩图形。 - * @property {String|Function} align 可视对象相对于父容器的对齐方式。取值可查看Hilo.align枚举对象。 - * @property {Container} parent 可视对象的父容器。只读属性。 - * @property {Number} depth 可视对象的深度,也即z轴的序号。只读属性。 - * @property {Drawable} drawable 可视对象的可绘制对象。供高级开发使用。 - * @property {Array} boundsArea 可视对象的区域顶点数组。格式为:[{x:10, y:10}, {x:20, y:20}]。 + * @property {String} id The identifier for the view. + * @property {Number} x The position of the view on the x axis relative to the local coordinates of the parent, default value is 0. + * @property {Number} y The position of the view on the y axis relative to the local coordinates of the parent, default value is 0. + * @property {Number} width The width of the view, default value is 0. + * @property {Number} height The height of the view, default value is 0. + * @property {Number} alpha The opacity of the view, default value is 1. + * @property {Number} rotation The rotation of the view in angles, default value is 0. + * @property {Boolean} visible The visibility of the view. If false the vew will not be drawn, default value is true. + * @property {Number} pivotX Position of the center point on the x axis of the view, default value is 0. + * @property {Number} pivotY Position of the center point on the y axis of the view, default value is 0. + * @property {Number} scaleX The x axis scale factor of the view, default value is 1. + * @property {Number} scaleY The y axis scale factor of the view, default value is 1. + * @property {Boolean} pointerEnabled Is the view can receive DOM events, default value is true. + * @property {Object} background The background style to fill the view, can be css color, gradient or pattern of canvas + * @property {Graphics} mask Sets a mask for the view. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. A regular mask must be a Hilo.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 {String|Function} align The alignment of the view, the value must be one of Hilo.align enum. + * @property {Container} parent The parent view of this view, readonly! + * @property {Number} depth The z index of the view, readonly! + * @property {Drawable} drawable The drawable object of the view. Only for advanced develop. + * @property {Array} boundsArea The vertex points of the view, the points are relative to the center point. This is a example: [{x:10, y:10}, {x:20, y:20}]. */ var View = (function(){ @@ -2047,8 +2061,9 @@ return Class.create(/** @lends View.prototype */{ depth: -1, /** - * 返回可视对象的舞台引用。若对象没有被添加到舞台,则返回null。 - * @returns {Stage} 可视对象的舞台引用。 + * @language=en + * Get the stage object of the view. If the view doesn't add to any stage, null will be returned. + * @returns {Stage} The stage object of the view. */ getStage: function(){ var obj = this, parent; @@ -2060,26 +2075,29 @@ return Class.create(/** @lends View.prototype */{ }, /** - * 返回可视对象缩放后的宽度。 - * @returns {Number} 可视对象缩放后的宽度。 + * @language=en + * Get the scaled width of the view. + * @returns {Number} scaled width of the view. */ getScaledWidth: function(){ return this.width * this.scaleX; }, /** - * 返回可视对象缩放后的高度。 - * @returns {Number} 可视对象缩放后的高度。 + * @language=en + * Get the scaled height of the view. + * @returns {Number} scaled height of the view. */ getScaledHeight: function(){ return this.height * this.scaleY; }, /** - * 添加此对象到父容器。 - * @param {Container} container 一个容器。 - * @param {Uint} index 要添加到索引位置。 - * @returns {View} 可视对象本身。 + * @language=en + * Add current view to a Contaner. + * @param {Container} container Container object. + * @param {Uint} index The index of the view in container. + * @returns {View} Current view. */ addTo: function(container, index){ if(typeof index === 'number') container.addChildAt(this, index); @@ -2088,8 +2106,9 @@ return Class.create(/** @lends View.prototype */{ }, /** - * 从父容器里删除此对象。 - * @returns {View} 可视对象本身。 + * @language=en + * Remove current view from it's parent container + * @returns {View} Current view. */ removeFromParent: function(){ var parent = this.parent; @@ -2098,13 +2117,14 @@ return Class.create(/** @lends View.prototype */{ }, /** - * 获取可视对象在舞台全局坐标系内的外接矩形以及所有顶点坐标。 - * @returns {Array} 可视对象的顶点坐标数组vertexs。另vertexs还包含属性: + * @language=en + * Get the bounds of the view as a circumscribed rectangle and all vertex points relative to the coordinates of the stage. + * @returns {Array} The vertex points array, and the array contains the following properties: * */ getBounds: function(){ @@ -2138,8 +2158,9 @@ return Class.create(/** @lends View.prototype */{ }, /** - * 获取可视对象相对于其某个祖先(默认为最上层容器)的连接矩阵。 - * @param {View} ancestor 可视对象的相对的祖先容器。 + * @language=en + * Get the matrix that can transform points from current view coordinates to the ancestor container coordinates. + * @param {View} ancestor The ancestor of current view, default value is the top container. * @private */ getConcatenatedMatrix: function(ancestor){ @@ -2165,11 +2186,12 @@ return Class.create(/** @lends View.prototype */{ }, /** - * 检测由x和y参数指定的点是否在其外接矩形之内。 - * @param {Number} x 要检测的点的x轴坐标。 - * @param {Number} y 要检测的点的y轴坐标。 - * @param {Boolean} usePolyCollision 是否使用多边形碰撞检测。默认为false。 - * @returns {Boolean} 点是否在可视对象之内。 + * @language=en + * Determining whether a point is in the circumscribed rectangle of current view. + * @param {Number} x The x axis relative to the stage coordinates. + * @param {Number} y The y axis relative to the stage coordinates. + * @param {Boolean} usePolyCollision Is use polygon collision, default value is false. + * @returns {Boolean} the point is in the circumscribed rectangle of current view. */ hitTestPoint: function(x, y, usePolyCollision){ var bound = this.getBounds(), @@ -2183,9 +2205,10 @@ return Class.create(/** @lends View.prototype */{ }, /** - * 检测object参数指定的对象是否与其相交。 - * @param {View} object 要检测的可视对象。 - * @param {Boolean} usePolyCollision 是否使用多边形碰撞检测。默认为false。 + * @language=en + * Determining whether an object is in the circumscribed rectangle of current view. + * @param {View} object The object need to determining. + * @param {Boolean} usePolyCollision Is use polygon collision, default value is false. */ hitTestObject: function(object, usePolyCollision){ var b1 = this.getBounds(), @@ -2200,9 +2223,10 @@ return Class.create(/** @lends View.prototype */{ }, /** - * 可视对象的基本渲染实现,用于框架内部或高级开发使用。通常应该重写render方法。 - * @param {Renderer} renderer 渲染器。 - * @param {Number} delta 渲染时时间偏移量。 + * @language=en + * The method to render current display object. Only for advanced develop. + * @param {Renderer} renderer Renderer object. + * @param {Number} delta The delta time of render. * @protected */ _render: function(renderer, delta){ @@ -2213,13 +2237,15 @@ return Class.create(/** @lends View.prototype */{ } }, /** - * 冒泡鼠标事件 + * @language=en + * Mouse event */ _fireMouseEvent:function(e){ e.eventCurrentTarget = this; this.fire(e); - //处理mouseover事件 mouseover不需要阻止冒泡 + // 处理mouseover事件 mouseover不需要阻止冒泡 + // handle mouseover event, mouseover needn't stop propagation. if(e.type == "mousemove"){ if(!this.__mouseOver){ this.__mouseOver = true; @@ -2232,7 +2258,8 @@ return Class.create(/** @lends View.prototype */{ this.__mouseOver = false; } - //向上冒泡 + // 向上冒泡 + // handle event propagation var parent = this.parent; if(!e._stopped && !e._stopPropagationed && parent){ if(e.type == "mouseout" || e.type == "touchout"){ @@ -2247,25 +2274,28 @@ return Class.create(/** @lends View.prototype */{ }, /** - * 更新可视对象,此方法会在可视对象渲染之前调用。此函数可以返回一个Boolean值。若返回false,则此对象不会渲染。默认值为null。 - * 限制:如果在此函数中改变了可视对象在其父容器中的层级,当前渲染帧并不会正确渲染,而是在下一渲染帧。可在其父容器的onUpdate方法中来实现。 + * @language=en + * This method will call while the view need update(usually caused by ticker update). This method can return a Boolean value, if return false, the view will not be drawn. + * Limit: If you change the index in it's parent, it will not be drawn correct in current frame but next frame is correct. * @type Function * @default null */ onUpdate: null, /** - * 可视对象的具体渲染逻辑。子类可通过覆盖此方法实现自己的渲染。 - * @param {Renderer} renderer 渲染器。 - * @param {Number} delta 渲染时时间偏移量。 + * @language=en + * The render method of current view. The subclass can implement it's own render logic by rewrite this function. + * @param {Renderer} renderer Renderer object. + * @param {Number} delta The delta time of render. */ render: function(renderer, delta){ renderer.draw(this); }, /** - * 返回可视对象的字符串表示。 - * @returns {String} 可视对象的字符串表示。 + * @language=en + * Get a string representing current view. + * @returns {String} string representing current view. */ toString: function(){ return Hilo.viewToString(this); @@ -2273,6 +2303,7 @@ return Class.create(/** @lends View.prototype */{ }); /** + * @language=en * @private */ function pointInPolygon(x, y, poly){ @@ -2310,6 +2341,7 @@ function pointInPolygon(x, y, poly){ } /** + * @language=en * @private */ function polygonCollision(poly1, poly2){ @@ -2319,6 +2351,7 @@ function polygonCollision(poly1, poly2){ } /** + * @language=en * @private */ function doSATCheck(poly1, poly2, result){ @@ -2377,22 +2410,19 @@ return View; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/CacheMixin', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/Drawable'], function(Hilo, Class, Drawable){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + var _cacheCanvas = Hilo.createElement('canvas'); var _cacheContext = _cacheCanvas.getContext('2d'); /** - * @class CacheMixin是一个包含cache功能的mixin。可以通过 Class.mix(target, CacheMixin) 来为target增加cache功能。 + * @language=en + * @class CacheMixin A mixin that contains cache method.You can mix cache method to the target by use Class.mix(target, CacheMixin). * @mixin * @static * @module hilo/view/CacheMixin @@ -2403,8 +2433,9 @@ var _cacheContext = _cacheCanvas.getContext('2d'); var CacheMixin = { _cacheDirty:true, /** - * 缓存到图片里。可用来提高渲染效率。 - * @param {Boolean} forceUpdate 是否强制更新缓存 + * @language=en + * Cache the view. + * @param {Boolean} forceUpdate is force update cache. */ cache: function(forceUpdate){ if(forceUpdate || this._cacheDirty || !this._cacheImage){ @@ -2412,7 +2443,8 @@ var CacheMixin = { } }, /** - * 更新缓存 + * @language=en + * Update the cache. */ updateCache:function(){ //TODO:width, height自动判断 @@ -2426,7 +2458,8 @@ var CacheMixin = { this._cacheDirty = false; }, /** - * 设置缓存是否dirty + * @language=en + * set the cache state diry. */ setCacheDirty:function(dirty){ this._cacheDirty = dirty; @@ -2437,29 +2470,26 @@ return CacheMixin; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/Container', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View'], function(Hilo, Class, View){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * @class Container是所有容器类的基类。每个Container都可以添加其他可视对象为子级。 + * @language=en + * @class Container is the base class to all container classes. Each Container can add other view object as children. * @augments View - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @param {Object} properties Properties parameters of the object to create. Contains all writable properties of this class. * @module hilo/view/Container * @requires hilo/core/Hilo * @requires hilo/core/Class * @requires hilo/view/View - * @property {Array} children 容器的子元素列表。只读。 - * @property {Boolean} pointerChildren 指示容器的子元素是否能响应用户交互事件。默认为true。 - * @property {Boolean} clipChildren 指示是否裁剪超出容器范围的子元素。默认为false。 + * @property {Array} children List of children elements of the container, readonly! + * @property {Boolean} pointerChildren Whether children elements of the container can response to user interactive events, default value is true. + * @property {Boolean} clipChildren Whether clip children elements which are out of the container, default value is false. */ var Container = Class.create(/** @lends Container.prototype */{ Extends: View, @@ -2477,17 +2507,19 @@ var Container = Class.create(/** @lends Container.prototype */{ clipChildren: false, /** - * 返回容器的子元素的数量。 - * @returns {Uint} 容器的子元素的数量。 + * @language=en + * Return the amount of the children elements of the container. + * @returns {Uint} The amount of the children elements of the container. */ getNumChildren: function(){ return this.children.length; }, /** - * 在指定索引位置添加子元素。 - * @param {View} child 要添加的子元素。 - * @param {Number} index 指定的索引位置,从0开始。 + * @language=en + * Add child element at given index. + * @param {View} child Element to add. + * @param {Number} index The given index position, range from 0. */ addChildAt: function(child, index){ var children = this.children, @@ -2508,10 +2540,12 @@ var Container = Class.create(/** @lends Container.prototype */{ children.splice(index, 0, child); //直接插入,影响插入位置之后的深度 + //Insert directly, this will affect depth of elements after the index. if(childIndex < 0){ this._updateChildren(index); } //只是移动时影响中间段的深度 + //Will affect depth of elements in the middle during moving else{ var startIndex = childIndex < index ? childIndex : index; var endIndex = childIndex < index ? index : childIndex;; @@ -2522,8 +2556,9 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 在最上面添加子元素。 - * @param {View} child 要添加的子元素。 + * @language=en + * Add child element at the top. + * @param {View} child Elements to add. */ addChild: function(child){ var total = this.children.length, @@ -2536,9 +2571,10 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 在指定索引位置删除子元素。 - * @param {Int} index 指定删除元素的索引位置,从0开始。 - * @returns {View} 被删除的对象。 + * @language=en + * Remove element at the index. + * @param {Int} index Index of the element to remove, range from 0. + * @returns {View} Element had been removed. */ removeChildAt: function(index){ var children = this.children; @@ -2578,18 +2614,20 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 删除指定的子元素。 - * @param {View} child 指定要删除的子元素。 - * @returns {View} 被删除的对象。 + * @language=en + * Remove the given child element. + * @param {View} child The child element to remove. + * @returns {View} Element had been removed. */ removeChild: function(child){ return this.removeChildAt(this.getChildIndex(child)); }, /** - * 删除指定id的子元素。 - * @param {String} id 指定要删除的子元素的id。 - * @returns {View} 被删除的对象。 + * @language=en + * Remove child element by its id. + * @param {String} id The id of element to remove. + * @returns {View} Element had been removed. */ removeChildById: function(id){ var children = this.children, child; @@ -2604,8 +2642,9 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 删除所有的子元素。 - * @returns {Container} 容器本身。 + * @language=en + * Remove all children elements. + * @returns {Container} Container itself. */ removeAllChildren: function(){ while(this.children.length) this.removeChildAt(0); @@ -2613,8 +2652,9 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 返回指定索引位置的子元素。 - * @param {Number} index 指定要返回的子元素的索引值,从0开始。 + * @language=en + * Return child element at the given index. + * @param {Number} index The index of the element, range from 0. */ getChildAt: function(index){ var children = this.children; @@ -2623,8 +2663,9 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 返回指定id的子元素。 - * @param {String} id 指定要返回的子元素的id。 + * @language=en + * Return child element at the given id. + * @param {String} id The id of child element to return. */ getChildById: function(id){ var children = this.children, child; @@ -2636,17 +2677,19 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 返回指定子元素的索引值。 - * @param {View} child 指定要返回索引值的子元素。 + * @language=en + * Return index value of the given child element. + * @param {View} child The child element need to get its index. */ getChildIndex: function(child){ return this.children.indexOf(child); }, /** - * 设置子元素的索引位置。 - * @param {View} child 指定要设置的子元素。 - * @param {Number} index 指定要设置的索引值。 + * @language=en + * Set the index of child element. + * @param {View} child The child element need to set index. + * @param {Number} index The index to set to the element. */ setChildIndex: function(child, index){ var children = this.children, @@ -2663,9 +2706,10 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 交换两个子元素的索引位置。 - * @param {View} child1 指定要交换的子元素A。 - * @param {View} child2 指定要交换的子元素B。 + * @language=en + * Swap index between two child elements. + * @param {View} child1 Child element A. + * @param {View} child2 Child element B. */ swapChildren: function(child1, child2){ var children = this.children, @@ -2679,9 +2723,10 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 交换两个指定索引位置的子元素。 - * @param {Number} index1 指定要交换的索引位置A。 - * @param {Number} index2 指定要交换的索引位置B。 + * @language=en + * Swap two children elements at given indexes. + * @param {Number} index1 Given index A. + * @param {Number} index2 Given index B. */ swapChildrenAt: function(index1, index2){ var children = this.children, @@ -2695,8 +2740,9 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 根据指定键值或函数对子元素进行排序。 - * @param {Object} keyOrFunction 如果此参数为String时,则根据子元素的某个属性值进行排序;如果此参数为Function时,则根据此函数进行排序。 + * @language=en + * Sort children elements by the given key or function. + * @param {Object} keyOrFunction If is String, sort children elements by the given property string; If is Function, sort by the function. */ sortChildren: function(keyOrFunction){ var fn = keyOrFunction, @@ -2712,7 +2758,8 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 更新子元素。 + * @language=en + * Update children elements. * @private */ _updateChildren: function(start, end){ @@ -2727,8 +2774,9 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 返回是否包含参数指定的子元素。 - * @param {View} child 指定要测试的子元素。 + * @language=en + * Return whether this container contains the parameter described child element. + * @param {View} child The child element to test. */ contains: function(child){ while(child = child.parent){ @@ -2740,12 +2788,13 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 返回由x和y指定的点下的对象。 - * @param {Number} x 指定点的x轴坐标。 - * @param {Number} y 指定点的y轴坐标。 - * @param {Boolean} usePolyCollision 指定是否使用多边形碰撞检测。默认为false。 - * @param {Boolean} global 使用此标志表明将查找所有符合的对象,而不仅仅是第一个,即全局匹配。默认为false。 - * @param {Boolean} eventMode 使用此标志表明将在事件模式下查找对象。默认为false。 + * @language=en + * Return object at the point positioned by given values on x axis and y axis. + * @param {Number} x The point's value on the coordinate's x axis. + * @param {Number} y The point's value on the coordinate's y asix. + * @param {Boolean} usePolyCollision Whether use polygon collision detection, default value is false. + * @param {Boolean} global Whether return all elements that match the condition, default value is false. + * @param {Boolean} eventMode Whether find elements under event mode, default value is false. */ getViewAtPoint: function(x, y, usePolyCollision, global, eventMode){ var result = global ? [] : null, @@ -2773,7 +2822,8 @@ var Container = Class.create(/** @lends Container.prototype */{ }, /** - * 覆盖渲染方法。 + * @language=en + * Rewrite render method. * @private */ render: function(renderer, delta){ @@ -2789,24 +2839,22 @@ var Container = Class.create(/** @lends Container.prototype */{ }); + return Container; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/Stage', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/Container', 'hilo/renderer/CanvasRenderer', 'hilo/renderer/DOMRenderer', 'hilo/renderer/WebGLRenderer'], function(Hilo, Class, Container, CanvasRenderer, DOMRenderer, WebGLRenderer){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** - * 示例: + * @language=en + * Demo: *
  * var stage = new Hilo.Stage({
  *     renderType:'canvas',
@@ -2815,16 +2863,16 @@ define('hilo/view/Stage', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/Conta
  *     height: 480
  * });
  * 
- * @class 舞台是可视对象树的根,可视对象只有添加到舞台或其子对象后才会被渲染出来。创建一个hilo应用一般都是从创建一个stage开始的。 + * @class Stage is the root of all visual object tree, any visual object will be render only after being added to Stage or any children elements of Stage. Normally, every hilo application start with an stage instance. * @augments Container - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。主要有: + * @param {Object} properties Properties parameters for the object. Includes all writable properties of this class. Some important like: * * @module hilo/view/Stage * @requires hilo/core/Hilo @@ -2833,10 +2881,10 @@ define('hilo/view/Stage', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/Conta * @requires hilo/renderer/CanvasRenderer * @requires hilo/renderer/DOMRenderer * @requires hilo/renderer/WebGLRenderer - * @property {HTMLCanvasElement|HTMLElement} canvas 舞台所对应的画布。它可以是一个canvas或一个普通的div。只读属性。 - * @property {Renderer} renderer 舞台渲染器。只读属性。 - * @property {Boolean} paused 指示舞台是否暂停刷新渲染。 - * @property {Object} viewport 舞台内容在页面中的渲染区域。包含的属性有:left、top、width、height。只读属性。 + * @property {HTMLCanvasElement|HTMLElement} canvas The canvas the Stage is related to. It can be a canvas or a div element, readonly! + * @property {Renderer} renderer Stage renderer, readonly! + * @property {Boolean} paused Paused Stage rendering. + * @property {Object} viewport Rendering area of the Stage. Including properties like: left, top, width, height. readonly! */ var Stage = Class.create(/** @lends Stage.prototype */{ Extends: Container, @@ -2861,6 +2909,7 @@ var Stage = Class.create(/** @lends Stage.prototype */{ viewport: null, /** + * @language=en * @private */ _initRenderer: function(properties){ @@ -2892,7 +2941,7 @@ var Stage = Class.create(/** @lends Stage.prototype */{ this.renderer = new DOMRenderer(props); break; case 'webgl': - if(WebGLRenderer.isSupport()){ + if(WebGLRenderer.isSupported){ this.renderer = new WebGLRenderer(props); } else{ @@ -2907,9 +2956,10 @@ var Stage = Class.create(/** @lends Stage.prototype */{ }, /** - * 添加舞台画布到DOM容器中。注意:此方法覆盖了View.addTo方法。 - * @param {HTMLElement} domElement 一个dom元素。 - * @returns {Stage} 舞台本身,可用于链式调用。 + * @language=en + * Add Stage canvas to DOM container. Note: this function overwrite View.addTo function. + * @param {HTMLElement} domElement An dom element. + * @returns {Stage} The Stage Object, chained call supported. */ addTo: function(domElement){ var canvas = this.canvas; @@ -2920,8 +2970,9 @@ var Stage = Class.create(/** @lends Stage.prototype */{ }, /** - * 调用tick会触发舞台的更新和渲染。开发者一般无需使用此方法。 - * @param {Number} delta 调度器当前调度与上次调度tick之间的时间差。 + * @language=en + * Invoke tick function and Stage will update and render. Developer may not need to use this funciton. + * @param {Number} delta The time had pass between this tick invoke and last tick invoke. */ tick: function(delta){ if(!this.paused){ @@ -2930,10 +2981,11 @@ var Stage = Class.create(/** @lends Stage.prototype */{ }, /** - * 开启/关闭舞台的DOM事件响应。要让舞台上的可视对象响应用户交互,必须先使用此方法开启舞台的相应事件的响应。 - * @param {String|Array} type 要开启/关闭的事件名称或数组。 - * @param {Boolean} enabled 指定开启还是关闭。如果不传此参数,则默认为开启。 - * @returns {Stage} 舞台本身。链式调用支持。 + * @language=en + * Turn on/off Stage response to DOM event. To make visual objects on the Stage interactive, use this function to turn on Stage's responses to events. + * @param {String|Array} type The event name or array that need to turn on/off. + * @param {Boolean} enabled Whether turn on or off the response method of stage DOM event. If not provided, default value is true. + * @returns {Stage} The Stage Object, chained call supported. */ enableDOMEvent: function(type, enabled){ var me = this, @@ -2956,7 +3008,8 @@ var Stage = Class.create(/** @lends Stage.prototype */{ }, /** - * DOM事件处理函数。此方法会把事件调度到事件的坐标点所对应的可视对象。 + * @language=en + * DOM events handler function. This funciton will invoke events onto the visual object, which is on the position of the coordinate where the events is invoked. * @private */ _onDOMEvent: function(e){ @@ -2976,7 +3029,7 @@ var Stage = Class.create(/** @lends Stage.prototype */{ event.stageX = x = (x - viewport.left) / this.scaleX; event.stageY = y = (y - viewport.top) / this.scaleY; - //鼠标事件需要阻止冒泡方法 + //鼠标事件需要阻止冒泡方法 Prevent bubbling on mouse events. event.stopPropagation = function(){ this._stopPropagationed = true; }; @@ -2986,7 +3039,7 @@ var Stage = Class.create(/** @lends Stage.prototype */{ //fire mouseout/touchout event for last event target var leave = type === 'mouseout'; - //当obj和target不同 且obj不是target的子元素时才触发out事件 + //当obj和target不同 且obj不是target的子元素时才触发out事件 fire out event when obj and target isn't the same as well as obj is not a child element to target. if(target && (target != obj && (!target.contains || !target.contains(obj))|| leave)){ var out = (type === 'touchmove') ? 'touchout' : (type === 'mousemove' || leave || !obj) ? 'mouseout' : null; @@ -3019,8 +3072,9 @@ var Stage = Class.create(/** @lends Stage.prototype */{ }, /** - * 更新舞台在页面中的可视区域,即渲染区域。当舞台canvas的样式border、margin、padding等属性更改后,需要调用此方法更新舞台渲染区域。 - * @returns {Object} 舞台的可视区域。即viewport属性。 + * @language=en + * Update the viewport (rendering area) which Stage show on the page. Invoke this function to update viewport when Stage canvas changes border, margin or padding properties. + * @returns {Object} The visible area of the Stage (the viewport property). */ updateViewport: function(){ var canvas = this.canvas, viewport = null; @@ -3031,10 +3085,11 @@ var Stage = Class.create(/** @lends Stage.prototype */{ }, /** - * 改变舞台的大小。 - * @param {Number} width 指定舞台新的宽度。 - * @param {Number} height 指定舞台新的高度。 - * @param {Boolean} forceResize 指定是否强制改变舞台大小,即不管舞台大小是否相同,仍然强制执行改变动作,可确保舞台、画布以及视窗之间的尺寸同步。 + * @language=en + * Resize the Stage. + * @param {Number} width The width of the new Stage. + * @param {Number} height The height of the new Stage. + * @param {Boolean} forceResize Whether forced to resize the Stage, means no matter the size of the Stage, force to change the size to keep Stage, canvas and window act at the same time. */ resize: function(width, height, forceResize){ if(forceResize || this.width !== width || this.height !== height){ @@ -3052,32 +3107,29 @@ return Stage; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/Bitmap', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View', 'hilo/view/Drawable'], function(Hilo, Class, View, Drawable){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** + * @language=en * *
- * 使用示例: + * Example: *
  * var bmp = new Hilo.Bitmap({image:imgElem, rect:[0, 0, 100, 100]});
  * stage.addChild(bmp);
  * 
- * @class Bitmap类表示位图图像类。 + * @class Bitmap * @augments View - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。此外还包括: + * @param {Object} properties the options of create Instance.It can contains all writable property and Moreover: * * @module hilo/view/Bitmap * @requires hilo/core/Hilo @@ -3105,10 +3157,11 @@ define('hilo/view/Bitmap', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View }, /** - * 设置位图的图片。 - * @param {Image|String} image 图片对象或地址。 - * @param {Array} rect 指定位图在图片image的矩形区域。 - * @returns {Bitmap} 位图本身。 + * @language=en + * set the image。 + * @param {Image|String} Image Object or URL。 + * @param {Array} rect the range of bitmap in the image。 + * @returns {Bitmap} self。 */ setImage: function(image, rect){ this.drawable.init({image:image, rect:rect}); @@ -3116,45 +3169,50 @@ define('hilo/view/Bitmap', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View this.width = rect[2]; this.height = rect[3]; } + else if(!this.width && !this.height){ + var rect = this.drawable.rect; + if(rect){ + this.width = rect[2]; + this.height = rect[3]; + } + } return this; } }); + return Bitmap; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/Sprite', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View', 'hilo/view/Drawable'], function(Hilo, Class, View, Drawable){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** + * @language=en * *
- * @class 动画精灵类。 + * @class Sprite animation class. * @augments View * @module hilo/view/Sprite * @requires hilo/core/Hilo * @requires hilo/core/Class * @requires hilo/view/View * @requires hilo/view/Drawable - * @param properties 创建对象的属性参数。可包含此类所有可写属性。此外还包括: + * @param properties Properties parameters for creating object, include all writable properties of this class, also include: * - * @property {number} currentFrame 当前播放帧的索引。从0开始。只读属性。 - * @property {boolean} paused 判断精灵是否暂停。默认为false。 - * @property {boolean} loop 判断精灵是否可以循环播放。默认为true。 - * @property {boolean} timeBased 指定精灵动画是否是以时间为基准。默认为false,即以帧为基准。 - * @property {number} interval 精灵动画的帧间隔。如果timeBased为true,则单位为毫秒,否则为帧数。 + * @property {number} currentFrame Current showing frame index, range from 0, readoly! + * @property {boolean} paused Is sprite paused, default value is false. + * @property {boolean} loop Is sprite play in loop, default value is false. + * @property {boolean} timeBased Is sprite animate base on time, default value is false (base on frame). + * @property {number} interval Interval between sprite animation frames. If timeBased is true, measured in ms, otherwise, measured in frames. */ var Sprite = Class.create(/** @lends Sprite.prototype */{ Extends: View, @@ -3169,30 +3227,32 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ if(properties.frames) this.addFrame(properties.frames); }, - _frames: null, //所有帧的集合 - _frameNames: null, //带名字name的帧的集合 - _frameElapsed: 0, //当前帧持续的时间或帧数 - _firstRender: true, //标记是否是第一次渲染 + _frames: null, //所有帧的集合 Collection of all frames + _frameNames: null, //带名字name的帧的集合 Collection of frames that with name + _frameElapsed: 0, //当前帧持续的时间或帧数 Elapsed time of current frame. + _firstRender: true, //标记是否是第一次渲染 Is the first render. paused: false, loop: true, timeBased: false, interval: 1, - currentFrame: 0, //当前帧的索引 + currentFrame: 0, //当前帧的索引 Index of current frame /** - * 返回精灵动画的总帧数。 - * @returns {Uint} 精灵动画的总帧数。 + * @language=en + * Return the total amount of sprite animation frames. + * @returns {Uint} The total amount of frames. */ getNumFrames: function(){ return this._frames ? this._frames.length : 0; }, /** - * 往精灵动画序列中增加帧。 - * @param {Object} frame 要增加的精灵动画帧数据。 - * @param {Int} startIndex 开始增加帧的索引位置。若不设置,默认为在末尾添加。 - * @returns {Sprite} Sprite对象本身。 + * @language=en + * Add frame into sprite. + * @param {Object} frame Frames to add into. + * @param {Int} startIndex The index to start adding frame, if is not given, add at the end of sprite. + * @returns {Sprite} Sprite itself. */ addFrame: function(frame, startIndex){ var start = startIndex != null ? startIndex : this._frames.length; @@ -3207,10 +3267,11 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 设置精灵动画序列指定索引位置的帧。 - * @param {Object} frame 要设置的精灵动画帧数据。 - * @param {Int} index 要设置的索引位置。 - * @returns {Sprite} Sprite对象本身。 + * @language=en + * Set the frame on the given index. + * @param {Object} frame The frame data to set on that index. + * @param {Int} index Index of the frame to set. + * @returns {Sprite} Sprite itself. */ setFrame: function(frame, index){ var frames = this._frames, @@ -3226,9 +3287,10 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 获取精灵动画序列中指定的帧。 - * @param {Object} indexOrName 要获取的帧的索引位置或别名。 - * @returns {Object} 精灵帧对象。 + * @language=en + * Get the frame of given parameter from sprite. + * @param {Object} indexOrName The index or name of the frame. + * @returns {Object} The sprite object. */ getFrame: function(indexOrName){ if(typeof indexOrName === 'number'){ @@ -3240,9 +3302,10 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 获取精灵动画序列中指定帧的索引位置。 - * @param {Object} frameValue 要获取的帧的索引位置或别名。 - * @returns {Object} 精灵帧对象。 + * @language=en + * Get frame index from sprite. + * @param {Object} frameValue Index or name of the frame. + * @returns {Object} Sprite frame object. */ getFrameIndex: function(frameValue){ var frames = this._frames, @@ -3265,8 +3328,9 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 播放精灵动画。 - * @returns {Sprite} Sprite对象本身。 + * @language=en + * Play sprite. + * @returns {Sprite} The Sprite object. */ play: function(){ this.paused = false; @@ -3274,8 +3338,9 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 暂停播放精灵动画。 - * @returns {Sprite} Sprite对象本身。 + * @language=en + * Pause playing sprite. + * @returns {Sprite} The Sprite object. */ stop: function(){ this.paused = true; @@ -3283,10 +3348,11 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 跳转精灵动画到指定的帧。 - * @param {Object} indexOrName 要跳转的帧的索引位置或别名。 - * @param {Boolean} pause 指示跳转后是否暂停播放。 - * @returns {Sprite} Sprite对象本身。 + * @language=en + * Jump to an assigned frame. + * @param {Object} indexOrName Index or name of an frame to jump to. + * @param {Boolean} pause Does pause after jumping to the new index. + * @returns {Sprite} The Sprite object. */ goto: function(indexOrName, pause){ var total = this._frames.length, @@ -3299,7 +3365,8 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 渲染方法。 + * @language=en + * Render function. * @private */ _render: function(renderer, delta){ @@ -3326,6 +3393,7 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** + * @language=en * @private */ _nextFrame: function(delta){ @@ -3361,10 +3429,11 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 设置指定帧的回调函数。即每当播放头进入指定帧时调用callback函数。若callback为空,则会删除回调函数。 - * @param {Int|String} frame 要指定的帧的索引位置或别名。 - * @param {Function} callback 指定回调函数。 - * @returns {Sprite} 精灵本身。 + * @language=en + * Set a callback on an assigned frame. Every time assigned frame is played, invoke the callback function. If callback is empty, callback function will be removed. + * @param {Int|String} frame Index or name of the assigned frame. + * @param {Function} callback Callback function. + * @returns {Sprite} The Sprite object. */ setFrameCallback: function(frame, callback){ frame = this.getFrame(frame); @@ -3373,7 +3442,8 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }, /** - * 精灵动画的播放头进入新帧时的回调方法。默认值为null。此方法已废弃,请使用addFrameCallback方法。 + * @language=en + * Callback function on when sprite enter a new frame. default value is null. Note: this function is obsolete, use addFrameCallback funciton instead. * @type Function * @deprecated */ @@ -3381,26 +3451,24 @@ var Sprite = Class.create(/** @lends Sprite.prototype */{ }); + return Sprite; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/DOMElement', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View', 'hilo/view/Drawable'], function(Hilo, Class, View, Drawable){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** + * @language=en * *
- * 使用示例: + * demo: *
  * var domView = new Hilo.DOMElement({
  *     element: Hilo.createElement('div', {
@@ -3416,11 +3484,11 @@ define('hilo/view/DOMElement', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/
  * }).addTo(stage);
  * 
* @name DOMElement - * @class DOMElement是dom元素的包装。 + * @class DOMElement is a wrapper of dom element. * @augments View - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。特殊属性有: + * @param {Object} properties create Objects properties. Contains all writable properties in this class. Special properties include: * * @module hilo/view/DOMElement * @requires hilo/core/Hilo @@ -3438,10 +3506,15 @@ var DOMElement = Class.create(/** @lends DOMElement.prototype */{ this.drawable = new Drawable(); var elem = this.drawable.domElement = properties.element || Hilo.createElement('div'); elem.id = this.id; + + if(this.pointerEnabled){ + elem.style.pointerEvents = 'visible'; + } }, /** - * 覆盖渲染方法。 + * @language=en + * Overwrite render method. * @private */ _render: function(renderer, delta){ @@ -3454,12 +3527,13 @@ var DOMElement = Class.create(/** @lends DOMElement.prototype */{ }, /** - * 覆盖渲染方法。 + * @language=en + * Overwrite render method. * @private */ render: function(renderer, delta){ - var canvas = renderer.canvas; - if(canvas.getContext){ + if(renderer.renderType !== 'dom'){ + var canvas = renderer.canvas; var elem = this.drawable.domElement, depth = this.depth, nextElement = canvas.nextSibling, nextDepth; if(elem.parentNode) return; @@ -3483,38 +3557,35 @@ return DOMElement; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/Graphics', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View', 'hilo/view/CacheMixin'], function(Hilo, Class, View, CacheMixin){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** + * @language=en * *
- * @class Graphics类包含一组创建矢量图形的方法。 + * @class Graphics class contains a group of functions for creating vector graphics. * @augments View * @mixes CacheMixin - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @param {Object} properties Properties parameters of the object to create. Contains all writable properties of this class. * @module hilo/view/Graphics * @requires hilo/core/Hilo * @requires hilo/core/Class * @requires hilo/view/View * @requires hilo/view/CacheMixin - * @property {Number} lineWidth 笔画的线条宽度。默认为1。只读属性。 - * @property {Number} lineAlpha 笔画的线条透明度。默认为1。只读属性。 - * @property {String} lineCap 笔画的线条端部样式。可选值有:butt、round、square等,默认为null。只读属性。 - * @property {String} lineJoin 笔画的线条连接样式。可选值有:miter、round、bevel等,默认为null。只读属性。 - * @property {Number} miterLimit 斜连线长度和线条宽度的最大比率。此属性仅当lineJoin为miter时有效。默认值为10。只读属性。 - * @property {String} strokeStyle 笔画边框的样式。默认值为'0',即黑色。只读属性。 - * @property {String} fillStyle 内容填充的样式。默认值为'0',即黑色。只读属性。 - * @property {Number} fillAlpha 内容填充的透明度。默认值为0。只读属性。 + * @property {Number} lineWidth The thickness of lines in space units, default value is 1, readonly! + * @property {Number} lineAlpha The alpha value (transparency) of line, default value is 1, readonly! + * @property {String} lineCap The style of how every end point of line are drawn, value options: butt, round, square. default value is null, readonly! + * @property {String} lineJoin The joint style of two lines. value options: miter, round, bevel. default value is null, readonly! + * @property {Number} miterLimit The miter limit ratio in space units, works only when lineJoin value is miter. default value is 10, readonly! + * @property {String} strokeStyle The color or style to use for lines around shapes, default value is 0 (the black color), readonly! + * @property {String} fillStyle The color or style to use inside shapes, default value is 0 (the black color), readonly! + * @property {Number} fillAlpha The transparency of color or style inside shapes, default value is 0, readonly! */ var Graphics = (function(){ @@ -3544,14 +3615,15 @@ return Class.create(/** @lends Graphics.prototype */{ fillAlpha: 0, /** - * 指定绘制图形的线条样式。 - * @param {Number} thickness 线条的粗细值。默认为1。 - * @param {String} lineColor 线条的CSS颜色值。默认为黑色,即'0'。 - * @param {Number} lineAlpha 线条的透明度值。默认为不透明,即1。 - * @param {String} lineCap 线条的端部样式。可选值有:butt、round、square等,默认值为null。 - * @param {String} lineJoin 线条的连接样式。可选值有:miter、round、bevel等,默认值为null。 - * @param {Number} miterLimit 斜连线长度和线条宽度的最大比率。此属性仅当lineJoin为miter时有效。默认值为10。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Set the lines style for drawing shapes. + * @param {Number} thickness The thickness of lines, default value is 1. + * @param {String} lineColor The CSS color value of lines, default value is 0 (the black color). + * @param {Number} lineAlpha The transparency of lines, default value is 1 (fully opaque). + * @param {String} lineCap The style of how every end point of line are drawn, value options: butt, round, square. default value is null. + * @param {String} lineJoin The joint style of two lines. value options: miter, round, bevel. default value is null. + * @param {Number} miterLimit The miter limit ratio in space units, works only when lineJoin value is miter. default value is 10. + * @returns {Graphics} The Graphics Object. */ lineStyle: function(thickness, lineColor, lineAlpha, lineCap, lineJoin, miterLimit){ var me = this, addAction = me._addAction; @@ -3567,10 +3639,11 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 指定绘制图形的填充样式和透明度。 - * @param {String} fill 填充样式。可以是color、gradient或pattern。 - * @param {Number} alpha 透明度。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Set how to fill shapes and the transparency. + * @param {String} fill Filling style. this can be color, gradient or pattern. + * @param {Number} alpha Transparency. + * @returns {Graphics} The Graphics Object. */ beginFill: function(fill, alpha){ var me = this, addAction = me._addAction; @@ -3582,8 +3655,9 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 应用并结束笔画的绘制和图形样式的填充。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Apply and end lines-drawing and shapes-filling. + * @returns {Graphics} The Graphics Object. */ endFill: function(){ var me = this, addAction = me._addAction; @@ -3595,14 +3669,15 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 指定绘制图形的线性渐变填充样式。 - * @param {Number} x0 渐变的起始点的x轴坐标。 - * @param {Number} y0 渐变的起始点的y轴坐标。 - * @param {Number} x1 渐变的结束点的x轴坐标。 - * @param {Number} y1 渐变的结束点的y轴坐标。 - * @param {Array} colors 渐变中使用的CSS颜色值数组。 - * @param {Array} ratois 渐变中开始与结束之间的位置数组。需与colors数组里的颜色值一一对应,介于0.0与1.0之间的值。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Set linear gradient filling style to draw shapes. + * @param {Number} x0 The x-coordinate value of the linear gradient start point. + * @param {Number} y0 The y-coordinate value of the linear gradient start point. + * @param {Number} x1 The x-coordinate value of the linear gradient end point. + * @param {Number} y1 The y-coordinate value of the linear gradient end point. + * @param {Array} colors An array of CSS colors used in the linear gradient. + * @param {Array} ratios An array of position between start point and end point, should be one-to-one to colors in the colors array. each value range between 0.0 to 1.0. + * @returns {Graphics} The Graphics Object. */ beginLinearGradientFill: function(x0, y0, x1, y1, colors, ratios){ var me = this, gradient = helpContext.createLinearGradient(x0, y0, x1, y1); @@ -3615,16 +3690,17 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 指定绘制图形的放射性渐变填充样式。 - * @param {Number} x0 渐变的起始圆的x轴坐标。 - * @param {Number} y0 渐变的起始圆的y轴坐标。 - * @param {Number} r0 渐变的起始圆的半径。 - * @param {Number} x1 渐变的结束圆的x轴坐标。 - * @param {Number} y1 渐变的结束圆的y轴坐标。 - * @param {Number} r1 渐变的结束圆的半径。 - * @param {Array} colors 渐变中使用的CSS颜色值数组。 - * @param {Array} ratois 渐变中开始与结束之间的位置数组。需与colors数组里的颜色值一一对应,介于0.0与1.0之间的值。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Set radial gradient filling style to draw shapes. + * @param {Number} x0 The x-coordinate value of the radial gradient start circle. + * @param {Number} y0 The y-coordinate value of the radial gradient start circle. + * @param {Number} r0 The diameter of the radial gradient start circle. + * @param {Number} x1 The x-coordinate value of the radial gradient end circle. + * @param {Number} y1 The y-coordinate value of the radial gradient end circle. + * @param {Number} r1 The radius of the radial gradient end circle. + * @param {Array} colors An array of CSS colors used in the radial gradient. + * @param {Array} ratios An array of position between start circle and end circle, should be one-to-one to colors in the colors array. each value range between 0.0 to 1.0. + * @returns {Graphics} The Graphics Object. */ beginRadialGradientFill: function(x0, y0, r0, x1, y1, r1, colors, ratios){ var me = this, gradient = helpContext.createRadialGradient(x0, y0, r0, x1, y1, r1); @@ -3637,10 +3713,11 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 开始一个位图填充样式。 - * @param {HTMLImageElement} image 指定填充的Image对象。 - * @param {String} repetition 指定填充的重复设置参数。它可以是以下任意一个值:repeat, repeat-x, repeat-y, no-repeat。默认为''。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Begin an image filling pattern. + * @param {HTMLImageElement} image The Image to fill. + * @param {String} repetition The fill repetition style, can be one of valus:repeat, repeat-x, repeat-y, no-repeat. default valus is ''. + * @returns {Graphics} The Graphics Object. */ beginBitmapFill: function(image, repetition){ var me = this, pattern = helpContext.createPattern(image, repetition || ''); @@ -3649,90 +3726,98 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 开始一个新的路径。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Begin a new path. + * @returns {Graphics} The Graphics Object. */ beginPath: function(){ return this._addAction(['beginPath']); }, /** - * 关闭当前的路径。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Close current path. + * @returns {Graphics} The Graphics Object. */ closePath: function(){ return this._addAction(['closePath']); }, /** - * 将当前绘制位置移动到点(x, y)。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Move current drawing point to a new point on coordinate values (x, y). + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @returns {Graphics} The Graphics Object. */ moveTo: function(x, y){ return this._addAction(['moveTo', x, y]); }, /** - * 绘制从当前位置开始到点(x, y)结束的直线。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Draw a line from current point to the point on the coordinate value (x, y). + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @returns {Graphics} The Graphics Object. */ lineTo: function(x, y){ return this._addAction(['lineTo', x, y]); }, /** - * 绘制从当前位置开始到点(x, y)结束的二次曲线。 - * @param {Number} cpx 控制点cp的x轴坐标。 - * @param {Number} cpy 控制点cp的y轴坐标。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Draw a quadratic Bézier curve from current point to the point on coordinate (x, y). + * @param {Number} cpx The x-coordinate value of the Bézier curve control point cp. + * @param {Number} cpy The y-coordinate value of the Bézier curve control point cp. + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @returns {Graphics} The Graphics Object. */ quadraticCurveTo: function(cpx, cpy, x, y){ return this._addAction(['quadraticCurveTo', cpx, cpy, x, y]); }, /** - * 绘制从当前位置开始到点(x, y)结束的贝塞尔曲线。 - * @param {Number} cp1x 控制点cp1的x轴坐标。 - * @param {Number} cp1y 控制点cp1的y轴坐标。 - * @param {Number} cp2x 控制点cp2的x轴坐标。 - * @param {Number} cp2y 控制点cp2的y轴坐标。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Draw a Bézier curve from current point to the point on coordinate (x, y). + * @param {Number} cp1x The x-coordinate value of the Bézier curve control point cp1. + * @param {Number} cp1y The y-coordinate value of the Bézier curve control point cp1. + * @param {Number} cp2x The x-coordinate value of the Bézier curve control point cp2. + * @param {Number} cp2y The y-coordinate value of the Bézier curve control point cp2. + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @returns {Graphics} The Graphics Object. */ bezierCurveTo: function(cp1x, cp1y, cp2x, cp2y, x, y){ return this._addAction(['bezierCurveTo', cp1x, cp1y, cp2x, cp2y, x, y]); }, /** - * 绘制一个矩形。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @param {Number} width 矩形的宽度。 - * @param {Number} height 矩形的高度。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Draw a rectangle. + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @param {Number} width The width of the rectangle. + * @param {Number} height The height of the rectangle. + * @returns {Graphics} The Graphics Object. */ drawRect: function(x, y, width, height){ return this._addAction(['rect', x, y, width, height]); }, /** - * 绘制一个复杂的圆角矩形。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @param {Number} width 圆角矩形的宽度。 - * @param {Number} height 圆角矩形的高度。 - * @param {Number} cornerTL 圆角矩形的左上圆角大小。 - * @param {Number} cornerTR 圆角矩形的右上圆角大小。 - * @param {Number} cornerBR 圆角矩形的右下圆角大小。 - * @param {Number} cornerBL 圆角矩形的左下圆角大小。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Draw a complex rounded rectangle. + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @param {Number} width The width of rounded rectangle. + * @param {Number} height The height of rounded rectangle. + * @param {Number} cornerTL The size of the rounded corner on the top-left of the rounded rectangle. + * @param {Number} cornerTR The size of the rounded corner on the top-right of the rounded rectangle. + * @param {Number} cornerBR The size of the rounded corner on the bottom-left of the rounded rectangle. + * @param {Number} cornerBL The size of the rounded corner on the bottom-right of the rounded rectangle. + * @returns {Graphics} The Graphics Object. */ drawRoundRectComplex: function(x, y, width, height, cornerTL, cornerTR, cornerBR, cornerBL){ var me = this, addAction = me._addAction; @@ -3749,36 +3834,39 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 绘制一个圆角矩形。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @param {Number} width 圆角矩形的宽度。 - * @param {Number} height 圆角矩形的高度。 - * @param {Number} cornerSize 圆角矩形的圆角大小。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Draw a rounded rectangle. + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @param {Number} width The width of rounded rectangle. + * @param {Number} height The height of rounded rectangle. + * @param {Number} cornerSize The size of all rounded corners. + * @returns {Graphics} The Graphics Object. */ drawRoundRect: function(x, y, width, height, cornerSize){ return this.drawRoundRectComplex(x, y, width, height, cornerSize, cornerSize, cornerSize, cornerSize); }, /** - * 绘制一个圆。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @param {Number} radius 圆的半径。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Draw a circle. + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @param {Number} radius The radius of the circle. + * @returns {Graphics} The Graphics Object. */ drawCircle: function(x, y, radius){ return this._addAction(['arc', x + radius, y + radius, radius, 0, Math.PI * 2, 0]); }, /** - * 绘制一个椭圆。 - * @param {Number} x x轴坐标。 - * @param {Number} y y轴坐标。 - * @param {Number} width 椭圆的宽度。 - * @param {Number} height 椭圆的高度。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Draw an ellipse. + * @param {Number} x The x-coordinate value. + * @param {Number} y The y-coordinate value. + * @param {Number} width The width of the ellipse. + * @param {Number} height The height of the ellipse. + * @returns {Graphics} The Graphics Object. */ drawEllipse: function(x, y, width, height){ var me = this; @@ -3798,13 +3886,14 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 根据参数指定的SVG数据绘制一条路径。 - * 代码示例: + * @language=en + * Draw a path from the SVG data given by parameters. + * Demo: *

var path = 'M250 150 L150 350 L350 350 Z';

*

var shape = new Hilo.Graphics({width:500, height:500});

*

shape.drawSVGPath(path).beginFill('#0ff').endFill();

- * @param {String} pathData 要绘制的SVG路径数据。 - * @returns {Graphics} Graphics对象本身。 + * @param {String} pathData The SVG path data to draw. + * @returns {Graphics} The Graphics Object. */ drawSVGPath: function(pathData){ var me = this, addAction = me._addAction, @@ -3834,7 +3923,8 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 执行全部绘制动作。内部私有方法。 + * @language=en + * Apply all draw actions. private function. * @private */ _draw: function(context){ @@ -3852,7 +3942,8 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 重写渲染实现。 + * @language=en + * Overwrite render function. * @private */ render: function(renderer, delta){ @@ -3866,8 +3957,9 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 清除所有绘制动作并复原所有初始状态。 - * @returns {Graphics} Graphics对象本身。 + * @language=en + * Clear all draw actions and reset to the initial state. + * @returns {Graphics} The Graphics Object. */ clear: function(){ var me = this; @@ -3889,7 +3981,8 @@ return Class.create(/** @lends Graphics.prototype */{ }, /** - * 添加一个绘制动作。内部私有方法。 + * @language=en + * Add a draw action, this is a private function. * @private */ _addAction: function(action){ @@ -3902,43 +3995,41 @@ return Class.create(/** @lends Graphics.prototype */{ })(); + return Graphics; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/Text', ['hilo/core/Class', 'hilo/core/Hilo', 'hilo/view/View', 'hilo/view/CacheMixin'], function(Class, Hilo, View, CacheMixin){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** + * @language=en * *
- * @class Text类提供简单的文字显示功能。复杂的文本功能可以使用DOMElement。 + * @class Text class provide basic text-display function, use DOMElement for complex text-display. * @augments View - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @param {Object} properties Properties parameters for the object. Includes all writable properties. * @module hilo/view/Text * @requires hilo/core/Class * @requires hilo/core/Hilo * @requires hilo/view/View * @requires hilo/view/CacheMixin - * @property {String} text 指定要显示的文本内容。 - * @property {String} color 指定使用的字体颜色。 - * @property {String} textAlign 指定文本的对齐方式。可以是以下任意一个值:'start', 'end', 'left', 'right', and 'center'。 - * @property {String} textVAlign 指定文本的垂直对齐方式。可以是以下任意一个值:'top', 'middle', 'bottom'。 - * @property {Boolean} outline 指定文本是绘制边框还是填充。 - * @property {Number} lineSpacing 指定文本的行距。单位为像素。默认值为0。 - * @property {Number} maxWidth 指定文本的最大宽度。默认值为200。 - * @property {String} font 文本的字体CSS样式。只读属性。设置字体样式请用setFont方法。 - * @property {Number} textWidth 指示文本内容的宽度,只读属性。仅在canvas模式下有效。 - * @property {Number} textHeight 指示文本内容的高度,只读属性。仅在canvas模式下有效。 + * @property {String} text Text to display. + * @property {String} color Color of the text. + * @property {String} textAlign Horizontal alignment way of the text. May be one of the following value:'start', 'end', 'left', 'right', and 'center'。 + * @property {String} textVAlign Vertical alignment way of the text. May be one of the following value:'top', 'middle', 'bottom'。 + * @property {Boolean} outline Draw the outline of the text or fill the text. + * @property {Number} lineSpacing The spacing between lines. Measured in px, default value is 0. + * @property {Number} maxWidth The max length of the text, default value is 200. + * @property {String} font Text's CSS font style, readonly! Use setFont function to set text font. + * @property {Number} textWidth Width of the text, readonly! Works only on canvas mode. + * @property {Number} textHeight Height of the text, readonly! Works only on canvas mode. */ var Text = Class.create(/** @lends Text.prototype */{ Extends: View, @@ -3965,9 +4056,10 @@ var Text = Class.create(/** @lends Text.prototype */{ textHeight: 0, //read-only /** - * 设置文本的字体CSS样式。 - * @param {String} font 要设置的字体CSS样式。 - * @returns {Text} Text对象本身。链式调用支持。 + * @language=en + * Set text CSS font style. + * @param {String} font Text CSS font style to set. + * @returns {Text} the Text object, chained call supported. */ setFont: function(font){ var me = this; @@ -3980,7 +4072,8 @@ var Text = Class.create(/** @lends Text.prototype */{ }, /** - * 覆盖渲染方法。 + * @language=en + * Overwrite render function. * @private */ render: function(renderer, delta){ @@ -4005,14 +4098,15 @@ var Text = Class.create(/** @lends Text.prototype */{ renderer.draw(this); } else{ - //TODO:自动更新cache + //TODO:自动更新cache TODO:auto update cache me.cache(); renderer.draw(me); } }, /** - * 在指定的渲染上下文上绘制文本。 + * @language=en + * Draw text under the assigned render context. * @private */ _draw: function(context){ @@ -4028,7 +4122,7 @@ var Text = Class.create(/** @lends Text.prototype */{ var lines = text.split(/\r\n|\r|\n|/); var width = 0, height = 0; var lineHeight = me._fontHeight + me.lineSpacing; - var i, line, w; + var i, line, w, len, wlen; var drawLines = []; for(i = 0, len = lines.length; i < len; i++){ @@ -4104,7 +4198,8 @@ var Text = Class.create(/** @lends Text.prototype */{ }, /** - * 在指定的渲染上下文上绘制一行文本。 + * @language=en + * Draw a line of text under the assigned render context. * @private */ _drawTextLine: function(context, text, y){ @@ -4126,9 +4221,10 @@ var Text = Class.create(/** @lends Text.prototype */{ Statics: /** @lends Text */{ /** - * 测算指定字体样式的行高。 - * @param {String} font 指定要测算的字体样式。 - * @return {Number} 返回指定字体的行高。 + * @language=en + * Measure the line height of the assigned text font style. + * @param {String} font Font style to measure. + * @return {Number} Return line height of the assigned font style. */ measureFontHeight: function(font){ var docElement = document.documentElement, fontHeight; @@ -4143,37 +4239,35 @@ var Text = Class.create(/** @lends Text.prototype */{ }); + return Text; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/BitmapText', ['hilo/core/Class', 'hilo/core/Hilo', 'hilo/view/Container', 'hilo/view/Bitmap'], function(Class, Hilo, Container, Bitmap){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** + * @language=en * *
- * @class BitmapText类提供使用位图文本的功能。当前仅支持单行文本。 + * @class BitmapText support bitmap text function ,but only support single-line text * @augments Container - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。 + * @param {Object} properties the options of create Instance.It can contains all writable property * @module hilo/view/BitmapText * @requires hilo/core/Class * @requires hilo/core/Hilo * @requires hilo/view/Container * @requires hilo/view/Bitmap - * @property {Object} glyphs 位图字体的字形集合。格式为:{letter:{image:img, rect:[0,0,100,100]}}。 - * @property {Number} letterSpacing 字距,即字符间的间隔。默认值为0。 - * @property {String} text 位图文本的文本内容。只读属性。设置文本请使用setFont方法。 - * @property {String} textAlign 文本对齐方式,值为left、center、right, 默认left。只读属性。设置文本请使用setTextAlign方法。 + * @property {Object} glyphs font glyph set of bitmap. format:{letter:{image:img, rect:[0,0,100,100]}} + * @property {Number} letterSpacing spacing of letter. default:0 + * @property {String} text content of bitmap text. Not writable,set this value by 'setFont' + * @property {String} textAlign property values:left、center、right, default:left,Not writable,set this property by 'setTextAlign' */ var BitmapText = Class.create(/** @lends BitmapText.prototype */{ Extends: Container, @@ -4197,9 +4291,10 @@ var BitmapText = Class.create(/** @lends BitmapText.prototype */{ textAlign:'left', /** - * 设置位图文本的文本内容。 - * @param {String} text 要设置的文本内容。 - * @returns {BitmapText} BitmapText对象本身。链式调用支持。 + * @language=en + * set the content of bitmap text + * @param {String} text content + * @returns {BitmapText} BitmapText Instance,support chained calls */ setText: function(text){ var me = this, str = text.toString(), len = str.length; @@ -4255,9 +4350,10 @@ var BitmapText = Class.create(/** @lends BitmapText.prototype */{ }, /** - * 设置位图文本的对齐方式。 - * @param textAlign 文本对齐方式,值为left、center、right - * @returns {BitmapText} BitmapText对象本身。链式调用支持。 + * @language=en + * set the textAlign of text。 + * @param textAlign value of textAlign:left、center、right + * @returns {BitmapText} itmapText Instance,support chained calls */ setTextAlign:function(textAlign){ this.textAlign = textAlign||this.textAlign; @@ -4277,9 +4373,10 @@ var BitmapText = Class.create(/** @lends BitmapText.prototype */{ }, /** - * 返回能否使用当前指定的字体显示提供的字符串。 - * @param {String} str 要检测的字符串。 - * @returns {Boolean} 是否能使用指定字体。 + * @language=en + * detect whether can display the string by the currently assigned font provided + * @param {String} str to detect string + * @returns {Boolean} whether can display the string */ hasGlyphs: function(str){ var glyphs = this.glyphs; @@ -4295,12 +4392,13 @@ var BitmapText = Class.create(/** @lends BitmapText.prototype */{ Statics:/** @lends BitmapText */{ _pool:[], /** - * 简易方式生成字形集合。 + * @language=en + * easy way to generate a collection of glyphs * @static - * @param {String} text 字符文本。 - * @param {Image} image 字符图片。 - * @param {Number} col 列数 默认和文本字数一样 - * @param {Number} row 行数 默认1行 + * @param {String} text character text. + * @param {Image} image character image. + * @param {Number} col default:the length of string + * @param {Number} row default:1 * @returns {BitmapText} BitmapText对象本身。链式调用支持。 */ createGlyphs:function(text, image, col, row){ @@ -4323,26 +4421,24 @@ var BitmapText = Class.create(/** @lends BitmapText.prototype */{ }); + return BitmapText; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/view/Button', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View', 'hilo/view/Drawable'], function(Hilo, Class, View, Drawable){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** + * @language=en * *
- * 示例: + * demo: *
  * var btn = new Hilo.Button({
  *     image: buttonImage,
@@ -4352,24 +4448,24 @@ define('hilo/view/Button', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View
  *     disabledState: {rect:[192, 0, 64, 64]}
  * });
  * 
- * @class Button类表示简单按钮类。它有弹起、经过、按下和不可用等四种状态。 + * @class Button class is a simple button class, contains four kinds of state: 'up', 'over', 'down', 'disabled' * @augments View - * @param {Object} properties 创建对象的属性参数。可包含此类所有可写属性。此外还包括: + * @param {Object} properties create object properties. Contains all writable properties. Also contains: * * @module hilo/view/Button * @requires hilo/core/Hilo * @requires hilo/core/Class * @requires hilo/view/View * @requires hilo/view/Drawable - * @property {Object} upState 按钮弹起状态的属性或其drawable的属性的集合。 - * @property {Object} overState 按钮经过状态的属性或其drawable的属性的集合。 - * @property {Object} downState 按钮按下状态的属性或其drawable的属性的集合。 - * @property {Object} disabledState 按钮不可用状态的属性或其drawable的属性的集合。 - * @property {String} state 按钮的状态名称。它是 Button.UP|OVER|DOWN|DISABLED 之一。 只读属性。 - * @property {Boolean} enabled 指示按钮是否可用。默认为true。只读属性。 - * @property {Boolean} useHandCursor 当设置为true时,表示指针滑过按钮上方时是否显示手形光标。默认为true。 + * @property {Object} upState The property of button 'up' state or collections of its drawable properties. + * @property {Object} overState The property of button 'over' state or collections of its drawable properties. + * @property {Object} downState The property of button 'down' state or collections of its drawable properties. + * @property {Object} disabledState The property of button 'disabled' state or collections of its drawable properties. + * @property {String} state the state name of button, could be one of Button.UP|OVER|DOWN|DISABLED, readonly! + * @property {Boolean} enabled Is button enabled. default value is true, readonly! + * @property {Boolean} useHandCursor If true, cursor over the button will become a pointer cursor, default value is true. */ var Button = Class.create(/** @lends Button.prototype */{ Extends: View, @@ -4392,9 +4488,10 @@ define('hilo/view/Button', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View useHandCursor: true, /** - * 设置按钮是否可用。 - * @param {Boolean} enabled 指示按钮是否可用。 - * @returns {Button} 按钮本身。 + * @language=en + * Set whether the button is enabled. + * @param {Boolean} enabled Show whether the button is enabled. + * @returns {Button} Return the button itself. */ setEnabled: function(enabled){ if(this.enabled != enabled){ @@ -4408,9 +4505,10 @@ define('hilo/view/Button', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View }, /** - * 设置按钮的状态。此方法由Button内部调用,一般无需使用此方法。 - * @param {String} state 按钮的新的状态。 - * @returns {Button} 按钮本身。 + * @language=en + * Set the state of the button. Invoke inside the Button and may not be used. + * @param {String} state New state of the button. + * @returns {Button} Return the button itself. */ setState: function(state){ if(this.state !== state){ @@ -4443,6 +4541,7 @@ define('hilo/view/Button', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View }, /** + * @language=en * overwrite * @private */ @@ -4475,22 +4574,26 @@ define('hilo/view/Button', ['hilo/core/Hilo', 'hilo/core/Class', 'hilo/view/View Statics: /** @lends Button */ { /** - * 按钮弹起状态的常量值,即:'up'。 + * @language=en + * Statics value of Button's 'up' state. * @type String */ UP: 'up', /** - * 按钮经过状态的常量值,即:'over'。 + * @language=en + * Statics value of Button's 'over' state. * @type String */ OVER: 'over', /** - * 按钮按下状态的常量值,即:'down'。 + * @language=en + * Statics value of Button's 'down' state. * @type String */ DOWN: 'down', /** - * 按钮不可用状态的常量值,即:'disabled'。 + * @language=en + * Statics value of Button's 'disabled' state. * @type String */ DISABLED: 'disabled' @@ -4501,19 +4604,16 @@ return Button; }); /** - * Hilo 1.0.0 for amd + * Hilo 1.0.1 for amd * Copyright 2016 alibaba.com * Licensed under the MIT License */ define('hilo/util/TextureAtlas', ['hilo/core/Class'], function(Class){ -/** - * Hilo - * Copyright 2015 alibaba.com - * Licensed under the MIT License - */ + /** + * @language=en * @class TextureAtlas纹理集是将许多小的纹理图片整合到一起的一张大图。这个类可根据一个纹理集数据读取纹理小图、精灵动画等。 * @param {Object} atlasData 纹理集数据。它可包含如下数据: *