Skip to content

Commit

Permalink
docs: fix TextureAtlas typo, see #107
Browse files Browse the repository at this point in the history
  • Loading branch information
06wj committed Dec 11, 2017
1 parent a14f506 commit dfc281f
Show file tree
Hide file tree
Showing 33 changed files with 1,685 additions and 1,952 deletions.
88 changes: 11 additions & 77 deletions docs/api-en/code/core/Hilo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
* Licensed under the MIT License
*/

var win = window, doc = document, docElem = doc.documentElement,
uid = 0;

var hasWarnedDict = {};

/**
* @namespace Hilo The underlying core set of methods.
* @static
* @module hilo/core/Hilo
* @requires hilo/util/browser
* @requires hilo/util/util
*/
var Hilo = (function(){

var win = window, doc = document, docElem = doc.documentElement,
uid = 0;

var hasWarnedDict = {};
return {
var Hilo = {
/**
* Hilo version
* @type String
Expand Down Expand Up @@ -60,11 +60,7 @@ return {
* @returns {Object} Object after copying.
*/
copy: function(target, source, strict){
for(var key in source){
if(!strict || target.hasOwnProperty(key) || target[key] !== undefined){
target[key] = source[key];
}
}
util.copy(target, source, strict);
if(!hasWarnedDict.copy){
hasWarnedDict.copy = true;
console.warn('Hilo.copy has been Deprecated! Use Hilo.util.copy instead.');
Expand All @@ -74,69 +70,9 @@ return {

/**
* Browser feature set includes:
* <ul>
* <li><b>jsVendor</b> - Browser vendors js value CSS prefix. For example: webkit.</li>
* <li><b>cssVendor</b> - Browser vendors css value CSS prefix.</li>
* <li><b>supportTransform</b> - Whether to support CSS Transform transformation.</li>
* <li><b>supportTransform3D</b> - Whether to support CSS Transform 3D transformation.</li>
* <li><b>supportStorage</b> - Whether to support local stores like localStorage.</li>
* <li><b>supportTouch</b> - Whether to support the touch event.</li>
* <li><b>supportCanvas</b> - Whether to support the canvas element.</li>
* </ul>
* @see browser
*/
browser: (function(){
var ua = navigator.userAgent;
var data = {
iphone: /iphone/i.test(ua),
ipad: /ipad/i.test(ua),
ipod: /ipod/i.test(ua),
ios: /iphone|ipad|ipod/i.test(ua),
android: /android/i.test(ua),
webkit: /webkit/i.test(ua),
chrome: /chrome/i.test(ua),
safari: /safari/i.test(ua),
firefox: /firefox/i.test(ua),
ie: /msie/i.test(ua),
opera: /opera/i.test(ua),
supportTouch: 'ontouchstart' in win,
supportCanvas: doc.createElement('canvas').getContext != null,
supportStorage: false,
supportOrientation: 'orientation' in win,
supportDeviceMotion: 'ondevicemotion' in win
};

//`localStorage` is null or `localStorage.setItem` throws error in some cases (e.g. localStorage is disabled)
try{
var value = 'hilo';
localStorage.setItem(value, value);
localStorage.removeItem(value);
data.supportStorage = true;
}catch(e){}

//vendor prefix
var jsVendor = data.jsVendor = data.webkit ? 'webkit' : data.firefox ? 'webkit' : data.opera ? 'o' : data.ie ? 'ms' : '';
var cssVendor = data.cssVendor = '-' + jsVendor + '-';

//css transform/3d feature dectection
var testElem = doc.createElement('div'), style = testElem.style;
var supportTransform = style[jsVendor + 'Transform'] != undefined;
var supportTransform3D = style[jsVendor + 'Perspective'] != undefined;
if(supportTransform3D){
testElem.id = 'test3d';
style = doc.createElement('style');
style.textContent = '@media ('+ cssVendor +'transform-3d){#test3d{height:3px}}';
doc.head.appendChild(style);

docElem.appendChild(testElem);
supportTransform3D = testElem.offsetHeight == 3;
doc.head.removeChild(style);
docElem.removeChild(testElem);
}
data.supportTransform = supportTransform;
data.supportTransform3D = supportTransform3D;

return data;
})(),
browser: browser,

/**
* Event enumeration objects include:
Expand Down Expand Up @@ -358,6 +294,4 @@ return {
+ 'rotate' + str3d + (use3d ? '(0, 0, 1, ' : '(') + obj.rotation + 'deg)'
+ 'scale' + str3d + '(' + obj.scaleX + ', ' + obj.scaleY + (use3d ? ', 1)' : ')');
}
};

})();
};
1 change: 1 addition & 0 deletions docs/api-en/code/renderer/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var DEG2RAD = Math.PI / 180;
* @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/core/Hilo
* @requires hilo/renderer/Renderer
* @requires hilo/geom/Matrix
* @property {WebGLRenderingContext} gl The WebGL context of the renderer, readonly.
Expand Down
2 changes: 1 addition & 1 deletion docs/api-en/code/util/TextureAtlas.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ return Class.create(/** @lends TextureAtlas.prototype */{
* @param {String} frames Frames message, eg:"0-5" means frame 0 to frame 5.
* @param {Number} w The width of each frame.
* @param {Number} h The height of each frame.
* @param {Bollean} loop Is play in loop.
* @param {Boolean} loop Is play in loop.
* @param {Number} duration The time between each frame. default value is 1 (Frame), but if timeBased is true, default value will be duration(milli-second).
* @example
* //demo1 make one animation
Expand Down
2 changes: 1 addition & 1 deletion docs/api-en/code/util/Ticker.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var Ticker = Class.create(/** @lends Ticker.prototype */{
* Get the fps.
*/
getMeasuredFPS: function(){
return this._measuredFPS;
return Math.min(this._measuredFPS, this._targetFPS);
},

/**
Expand Down
2 changes: 1 addition & 1 deletion docs/api-en/code/util/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ var browser = (function(){
* 是否支持检测设备方向orientation。
* @type {Boolean}
*/
supportOrientation: 'orientation' in win,
supportOrientation: 'orientation' in win || 'orientation' in win.screen,

/**
* 是否支持检测加速度devicemotion。
Expand Down
8 changes: 4 additions & 4 deletions docs/api-en/code/util/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ var drag = {
updateMouse(e);
that.off(Hilo.event.POINTER_START, onStart);

that.fire("dragStart", mouse);

that.__dragX = that.x - mouse.x;
that.__dragY = that.y - mouse.y;
Expand All @@ -60,26 +59,27 @@ var drag = {
}
stage.on(Hilo.event.POINTER_MOVE, onMove);
document.addEventListener(Hilo.event.POINTER_END, onStop);
that.fire("dragStart", mouse);
}

function onStop(e){
document.removeEventListener(Hilo.event.POINTER_END, onStop);
stage && stage.off(Hilo.event.POINTER_MOVE, onMove);

that.fire("dragEnd", mouse);
that.on(Hilo.event.POINTER_START, onStart);
that.fire("dragEnd", mouse);
}

function onMove(e){
updateMouse(e);

that.fire("dragMove", mouse);

var x = mouse.x + that.__dragX;
var y = mouse.y + that.__dragY;

that.x = Math.max(minX, Math.min(maxX, x));
that.y = Math.max(minY, Math.min(maxY, y));

that.fire("dragMove", mouse);
}

function updateMouse(e){
Expand Down
2 changes: 1 addition & 1 deletion docs/api-en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
</div>

<div class="col-md-9">
<div class="hilo-header">All Class Index<span class="small">(v1.1.0)</span></div>
<div class="hilo-header">All Class Index<span class="small">(v1.1.4)</span></div>
<table class="table table-striped table-bordered table-condensed">
<thead>
<tr>
Expand Down
23 changes: 12 additions & 11 deletions docs/api-en/symbols/Hilo.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ <h1 style="margin-top:0;">



<span style="display:block;margin:0 0 2px 0;">
<b style="margin-right:10px;">Requires</b>
<span><a href="../symbols/browser.html">hilo/util/browser</a></span>, <span><a href="../symbols/util.html">hilo/util/util</a></span>
</span>


<span style="display:block;margin:0 0 2px 0;">
<b style="margin-right:10px;">Source</b>
Expand Down Expand Up @@ -260,8 +265,6 @@ <h3 style="display:inline;margin-right:10px;">Properties</h3>
<div class="description">
<span class="label">static</span>
Browser feature set includes:
<ul>
<li><b>jsVendor</b> - Browser vendors js value CSS prefix.
</div>
</td>
<td>
Expand Down Expand Up @@ -574,22 +577,20 @@ <h3 style="margin-bottom:15px;">Property Detail</h3>
</div>
<div class="description">
Browser feature set includes:
<ul>
<li><b>jsVendor</b> - Browser vendors js value CSS prefix. For example: webkit.</li>
<li><b>cssVendor</b> - Browser vendors css value CSS prefix.</li>
<li><b>supportTransform</b> - Whether to support CSS Transform transformation.</li>
<li><b>supportTransform3D</b> - Whether to support CSS Transform 3D transformation.</li>
<li><b>supportStorage</b> - Whether to support local stores like localStorage.</li>
<li><b>supportTouch</b> - Whether to support the touch event.</li>
<li><b>supportCanvas</b> - Whether to support the canvas element.</li>
</ul>
</div>






<dl class="detailList">
<dt class="heading">see:</dt>

<dd><a href="../symbols/browser.html">browser</a></dd>

</dl>



</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/api-en/symbols/TextureAtlas.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ <h3 style="display:inline;margin-right:10px;">Methods</h3>

</td>
<td class="fixedFont">
<div><b><a href="../symbols/TextureAtlas.html#.createSpriteFrames">createSpriteFrames</a></b>(name:String|Array, frames:String, w:Number, h:Number, loop:Bollean, duration:Number, duration)
<div><b><a href="../symbols/TextureAtlas.html#.createSpriteFrames">createSpriteFrames</a></b>(name:String|Array, frames:String, w:Number, h:Number, loop:Boolean, duration:Number, duration)
</div>
<div class="description">
<span class="label">static</span>
Expand Down Expand Up @@ -400,7 +400,7 @@ <h3 style="margin-bottom:15px;">Constructor</h3>
<div class="member-box">
<div class="member-header">
[Static]
<b>createSpriteFrames</b>(name:String|Array, frames:String, w:Number, h:Number, loop:Bollean, duration:Number, duration)
<b>createSpriteFrames</b>(name:String|Array, frames:String, w:Number, h:Number, loop:Boolean, duration:Number, duration)
</div>
<div class="description">Shorthand method to create spirte frames</div>

Expand Down Expand Up @@ -441,7 +441,7 @@ <h3 style="margin-bottom:15px;">Constructor</h3>
</dt>

<dt style="margin-left:20px;font-weight:normal;">
<b>loop</b>:<span>Bollean</span>
<b>loop</b>:<span>Boolean</span>
— Is play in loop.
</dt>

Expand Down
2 changes: 1 addition & 1 deletion docs/api-en/symbols/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ <h1 style="margin-top:0;">

<span style="display:block;margin:0 0 2px 0;">
<b style="margin-right:10px;">Requires</b>
<span><a href="../symbols/Class.html">hilo/core/Class</a></span>, <span><a href="../symbols/Renderer.html">hilo/renderer/Renderer</a></span>, <span><a href="../symbols/Matrix.html">hilo/geom/Matrix</a></span>
<span><a href="../symbols/Class.html">hilo/core/Class</a></span>, <span><a href="../symbols/Hilo.html">hilo/core/Hilo</a></span>, <span><a href="../symbols/Renderer.html">hilo/renderer/Renderer</a></span>, <span><a href="../symbols/Matrix.html">hilo/geom/Matrix</a></span>
</span>


Expand Down
Loading

0 comments on commit dfc281f

Please sign in to comment.