[JS] Add common APIs for compatibility with web engine

This commit is contained in:
pandamicro 2015-09-06 08:57:43 +08:00
parent 4ad78778a8
commit 86fb0fc3bc
2 changed files with 17 additions and 2 deletions

View File

@ -786,6 +786,7 @@ cc.view.setDesignResolutionSize = function(width,height,resolutionPolicy){
cc.winSize = cc.director.getWinSize();
cc.visibleRect.init();
};
cc.view.setRealPixelResolution = cc.view.setDesignResolutionSize;
cc.view.setResolutionPolicy = function(resolutionPolicy){
var size = cc.view.getDesignResolutionSize();
cc.view.setDesignResolutionSize(size.width,size.height,resolutionPolicy);
@ -816,6 +817,10 @@ cc.audioEngine.end = function(){
this.stopMusic();
this.stopAllEffects();
};
cc.audioEngine.features = {
MULTI_CHANNEL: true,
AUTOPLAY: true
};
/**
* @type {Object}
* @name cc.configuration
@ -1365,8 +1370,18 @@ cc._initSys = function(config, CONFIG_KEY){
}
})();
/**
* Indicate the real pixel resolution of the whole game window
* @memberof cc.sys
* @name windowPixelResolution
* @type {Number}
*/
locSys.windowPixelResolution = cc.view.getFrameSize();
/** The type of browser */
locSys.browserType = null;//null in jsb
locSys.browserType = null; //null in jsb
/** The version of browser */
locSys.browserVersion = null; //null in jsb
capabilities = locSys.capabilities = {"opengl":true};
if( locSys.isMobile ) {

2
web

@ -1 +1 @@
Subproject commit 31263de3f661cdf42760884f162c56af0824ed0d
Subproject commit cd805fd64c7f27afdc3783274fa58fec92c6913e