Skip to content

Commit 720ea24

Browse files
committed
Issue cocos2d#1615 MainLoop and LabelTTF is working.
1 parent 7cd7cfd commit 720ea24

File tree

20 files changed

+1099
-807
lines changed

20 files changed

+1099
-807
lines changed

System/Sys.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/****************************************************************************
2+
http://www.cocos2d-html5.org
3+
http://www.cocos2d-iphone.org
4+
http://www.cocos2d-x.org
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.
23+
****************************************************************************/
24+
25+
var sys = sys || {};
26+
27+
/** LocalStorage is a local storage component.
28+
*/
29+
sys.localStorage = window.localStorage;
30+
31+
32+
/** Capabilities
33+
*/
34+
Object.defineProperties(sys,
35+
{
36+
"capabilities" : {
37+
get : function(){
38+
var capabilities = {"canvas":true};
39+
40+
// if (window.DeviceOrientationEvent!==undefined || window.OrientationEvent!==undefined)
41+
// capabilities["accelerometer"] = true;
42+
43+
if( 'ontouchstart' in document.documentElement )
44+
capabilities["touches"] = true;
45+
else if( 'onmouseup' in document.documentElement )
46+
capabilities["mouse"] = true;
47+
48+
if( 'onkeyup' in document.documentElement )
49+
capabilities["keyboard"] = true;
50+
51+
return capabilities;
52+
},
53+
enumerable : true,
54+
configurable : true
55+
},
56+
"os" : {
57+
get : function() {
58+
var iOS = ( navigator.userAgent.match(/(iPad|iPhone|iPod)/i) ? true : false );
59+
var isAndroid = navigator.userAgent.match(/android/i) || navigator.platform.match(/android/i) ? true : false;
60+
var OSName=navigator.appVersion;
61+
if (navigator.appVersion.indexOf("Win")!=-1)
62+
OSName="Windows";
63+
else if (navigator.appVersion.indexOf("Mac")!=-1)
64+
OSName="OS X";
65+
else if (navigator.appVersion.indexOf("X11")!=-1)
66+
OSName="UNIX";
67+
else if (navigator.appVersion.indexOf("Linux")!=-1)
68+
OSName="Linux";
69+
else if( iOS )
70+
OSName = "iOS";
71+
else if( isAndroid )
72+
OSName = "Android";
73+
},
74+
enumerable : true,
75+
configurable : true
76+
},
77+
"platform" : {
78+
get : function(){
79+
return "browser";
80+
},
81+
enumerable : true,
82+
configurable : true
83+
},
84+
"version" : {
85+
get : function(){
86+
return cc.ENGINE_VERSION;
87+
},
88+
enumerable : true,
89+
configurable : true
90+
}
91+
});

cocos2d/CCCamera.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ cc.Camera = cc.Class.extend({
113113

114114
/** sets the eye values in points */
115115
setEyeXYZ:function (eyeX, eyeY, eyeZ) {
116-
this._eyeX = eyeX * cc.CONTENT_SCALE_FACTOR;
117-
this._eyeY = eyeY * cc.CONTENT_SCALE_FACTOR;
118-
this._eyeZ = eyeZ * cc.CONTENT_SCALE_FACTOR;
116+
this._eyeX = eyeX ;
117+
this._eyeY = eyeY ;
118+
this._eyeZ = eyeZ ;
119119

120120
this._dirty = true;
121121
},
122122
/** sets the center values in points */
123123
setCenterXYZ:function (centerX, centerY, fenterZ) {
124-
this._centerX = centerX * cc.CONTENT_SCALE_FACTOR;
125-
this._centerY = centerY * cc.CONTENT_SCALE_FACTOR;
126-
this._centerZ = fenterZ * cc.CONTENT_SCALE_FACTOR;
124+
this._centerX = centerX ;
125+
this._centerY = centerY ;
126+
this._centerZ = fenterZ ;
127127

128128
this._dirty = true;
129129
},
@@ -138,11 +138,11 @@ cc.Camera = cc.Class.extend({
138138

139139
/** get the eye vector values in points */
140140
getEyeXYZ:function (eyeX, eyeY, eyeZ) {
141-
return {eyeX:this._eyeX / cc.CONTENT_SCALE_FACTOR, eyeY:this._eyeY / cc.CONTENT_SCALE_FACTOR, eyeZ: this._eyeZ / cc.CONTENT_SCALE_FACTOR};
141+
return {eyeX:this._eyeX , eyeY:this._eyeY , eyeZ: this._eyeZ };
142142
},
143143
/** get the center vector values int points */
144144
getCenterXYZ:function (centerX, centerY, centerZ) {
145-
return {centerX:this._centerX / cc.CONTENT_SCALE_FACTOR,centerY:this._centerY / cc.CONTENT_SCALE_FACTOR,centerZ:this._centerZ / cc.CONTENT_SCALE_FACTOR};
145+
return {centerX:this._centerX ,centerY:this._centerY ,centerZ:this._centerZ };
146146
},
147147
/** get the up vector values */
148148
getUpXYZ:function (upX, upY, upZ) {

0 commit comments

Comments
 (0)