Is load scene script update?

Reply

Generalsaibara Post a question • 0 person concerned • 0 replies • 417 views • 2016-07-01 17:31 • 来自相关话题

Audio file lags

Reply

Generalgeorge828 Post a question • 1 person concerned • 0 replies • 393 views • 2016-06-23 16:12 • 来自相关话题

type script example is not running

Reply

Generalterapist Post a question • 1 person concerned • 0 replies • 477 views • 2016-06-21 16:56 • 来自相关话题

actions on prefabs

Reply

Generalgustavofraguas Post a question • 1 person concerned • 0 replies • 427 views • 2016-06-15 19:23 • 来自相关话题

Non-Behaviour JavaScript and finding nodes

Reply

GeneralHowrad Post a question • 2 person concerned • 0 replies • 466 views • 2016-06-09 07:53 • 来自相关话题

Behaviour inherit

Reply

Generalmvttuit91 Post a question • 1 person concerned • 0 replies • 436 views • 2016-06-08 12:49 • 来自相关话题

How to add a tooltip on node?

Reply

Generalwarlockn Post a question • 1 person concerned • 0 replies • 466 views • 2016-06-01 20:55 • 来自相关话题

3rd party server

Reply

Generalwinterstar Post a question • 2 person concerned • 0 replies • 542 views • 2016-05-16 14:19 • 来自相关话题

Change default qici loader(Only applicable to the latest version 1.1.0)

GeneralQC-Cindy Published the article • 0 comments • 532 views • 2016-04-15 16:12 • 来自相关话题

At present QICI engine provides three built-in start loading interfaces, they are eating beans, progress bar interface and static background figure interface, here in the following we will talk about each start loading interface implementation:

1、Eating beans loading interface, shown as below,





 
This interface is the default engine loading interface, we only need to set the value of qici.config.loadingHandler to be "svgHandler" in the HTML file,shown as the red arrow marks below,






2、Using the progress bar loading interface,shown as below,





 
As the same we set the value of qici.config.loadingHandler to be “progressHandler” in Html file.

3、Using the static background figure loading interface,shown as below,





As the same we also just need to set the value of qici.config.loadingHandler,for the background we can set the backgroundStyle to be CSS type string in the qici.config.loading, such as below,
loadingHandler: 'backgroundHandler',
loading:{
backgroundStyle: "background-image:url(../../build/imgs/qici.png);background-size:100% 100%",
}Also we can customize our favorite start loading interface, in the below we will talk the circular progress bar as an example. The graph results as below,





 
The steps are as follows:
1, create a js file, the file name can be testLoading. Js, implement a class in the file, the name of the class can be called circleHandler, and this class must implement the following three methods:
A.void start (totalAssetCount) : when begin loading, the method will be called and the parameter is the total number of resources.
B. void progress (curCount) : resource loading progress notices, the parameter is the number of loaded resource.
C. void finish () : all resources to be loaded, the method will be called.
 
2, make the circleHandler class instantiation, then assigned to qici. LoadingHandler variables, as follows: qici. LoadingHandler = new circleHandler ();
The code is as below:
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};

if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());

//定义一个类
var circleHandler = function(){
this.tickState = 'normal';
};
circleHandler.prototype = {};
circleHandler.prototype.constructor = circleHandler;

//开始加载
circleHandler.prototype.start = function(totalAssetCount){
this.totalCount = totalAssetCount;
};

//加载进度
circleHandler.prototype.progress = function(curCount){

var percent = Math.floor(curCount / this.totalCount * 100);
var circle = document.getElementById('circle');
var imgLeft = -(percent*44+(percent*10))+'px'
circle.style.backgroundPosition = imgLeft+'\t' + '0px';
circle.innerHTML = percent+'%';
};

//资源加载完成
circleHandler.prototype.finish = function(){
this.tickState = 'fadeout';
this.startFadingOutTime = new Date().getTime();
};

circleHandler.prototype._tick = function() {

var self = qici.loadingHandler;
if (self.tickState === 'done')
return;

requestAnimationFrame(self._tick);
if (self.tickState === 'normal')
return;


var time = new Date().getTime();
var delta = time - self.startFadingOutTime;

var rate = delta / 500;
if (rate > 1) {
// 移除进度条
self.tickState = 'done';
var circle = document.getElementById('circle');
circle.parentNode.removeChild(circle);
}
else {
document.getElementById('circle').style.opacity = 1 - rate;
}
}
if (qici.config.loadingHandler === 'circleHandler')
document.write('<div id="circle" style="width:44px;margin:-22px 0px 0px -22px;position:absolute;left:50%;top:50%;height:44px;line-height:44px;text-align:center;z-index:10000;background: url(images/circle.png);"></div>');


if (qici.config.loadingHandler === 'circleHandler'){

//实例化circleHandler类
qici.loadingHandler = new circleHandler();
qici.loadingHandler._tick();
}1、When starting the html file, modify the qici.config.loadingHandler  to be custom  circleHandler,as below:
qici.config.loadingHandler = ‘circleHandler’;
2、When starting the html file, after loadedqc-loading.js,dispose the js file, shown as below, 
<body onload="qici.init();">
<div style="overflow:hidden;padding:0;margin:0;width:100%;height:100%;">
<div id="gameDiv" style="position:relative;"></div>
</div>
<script src='./lib/qc-loading.js'></script>
<script src="./testLoading.js"></script>
</body>
 
  查看全部
At present QICI engine provides three built-in start loading interfaces, they are eating beans, progress bar interface and static background figure interface, here in the following we will talk about each start loading interface implementation:

1、Eating beans loading interface, shown as below,

1.gif

 
This interface is the default engine loading interface, we only need to set the value of qici.config.loadingHandler to be "svgHandler" in the HTML file,shown as the red arrow marks below,

图片1.png


2、Using the progress bar loading interface,shown as below,

2.gif

 
As the same we set the value of qici.config.loadingHandler to be “progressHandler” in Html file.

3、Using the static background figure loading interface,shown as below,

3.gif

As the same we also just need to set the value of qici.config.loadingHandler,for the background we can set the backgroundStyle to be CSS type string in the qici.config.loading, such as below,
loadingHandler: 'backgroundHandler',
loading:{
backgroundStyle: "background-image:url(../../build/imgs/qici.png);background-size:100% 100%",
}
Also we can customize our favorite start loading interface, in the below we will talk the circular progress bar as an example. The graph results as below,

4.gif

 
The steps are as follows:
1, create a js file, the file name can be testLoading. Js, implement a class in the file, the name of the class can be called circleHandler, and this class must implement the following three methods:
A.void start (totalAssetCount) : when begin loading, the method will be called and the parameter is the total number of resources.
B. void progress (curCount) : resource loading progress notices, the parameter is the number of loaded resource.
C. void finish () : all resources to be loaded, the method will be called.
 
2, make the circleHandler class instantiation, then assigned to qici. LoadingHandler variables, as follows: qici. LoadingHandler = new circleHandler ();
The code is as below:
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|| window[vendors[x]+'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function(callback) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};

if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function(id) {
clearTimeout(id);
};
}());

//定义一个类
var circleHandler = function(){
this.tickState = 'normal';
};
circleHandler.prototype = {};
circleHandler.prototype.constructor = circleHandler;

//开始加载
circleHandler.prototype.start = function(totalAssetCount){
this.totalCount = totalAssetCount;
};

//加载进度
circleHandler.prototype.progress = function(curCount){

var percent = Math.floor(curCount / this.totalCount * 100);
var circle = document.getElementById('circle');
var imgLeft = -(percent*44+(percent*10))+'px'
circle.style.backgroundPosition = imgLeft+'\t' + '0px';
circle.innerHTML = percent+'%';
};

//资源加载完成
circleHandler.prototype.finish = function(){
this.tickState = 'fadeout';
this.startFadingOutTime = new Date().getTime();
};

circleHandler.prototype._tick = function() {

var self = qici.loadingHandler;
if (self.tickState === 'done')
return;

requestAnimationFrame(self._tick);
if (self.tickState === 'normal')
return;


var time = new Date().getTime();
var delta = time - self.startFadingOutTime;

var rate = delta / 500;
if (rate > 1) {
// 移除进度条
self.tickState = 'done';
var circle = document.getElementById('circle');
circle.parentNode.removeChild(circle);
}
else {
document.getElementById('circle').style.opacity = 1 - rate;
}
}
if (qici.config.loadingHandler === 'circleHandler')
document.write('<div id="circle" style="width:44px;margin:-22px 0px 0px -22px;position:absolute;left:50%;top:50%;height:44px;line-height:44px;text-align:center;z-index:10000;background: url(images/circle.png);"></div>');


if (qici.config.loadingHandler === 'circleHandler'){

//实例化circleHandler类
qici.loadingHandler = new circleHandler();
qici.loadingHandler._tick();
}
1、When starting the html file, modify the qici.config.loadingHandler  to be custom  circleHandler,as below:
qici.config.loadingHandler = ‘circleHandler’;
2、When starting the html file, after loadedqc-loading.js,dispose the js file, shown as below, 
<body onload="qici.init();">
<div style="overflow:hidden;padding:0;margin:0;width:100%;height:100%;">
<div id="gameDiv" style="position:relative;"></div>
</div>
<script src='./lib/qc-loading.js'></script>
<script src="./testLoading.js"></script>
</body>

 
 

​The difference among HTTP, WebSocket and Socket.

GeneralQC-Cindy Published the article • 0 comments • 597 views • 2016-01-06 16:32 • 来自相关话题

For these three concepts, many people do not know them clearly. Here as below we give a simple introduce, and then you can search more details on the internet by yourself. 
1, HTTP and WebSocket each is an application layer protocol, TCP/IP is a network layer and transport layer protocol, Socket is a TCP/IP protocol abstraction layer API package. 
 
2, HTTP-get, post requests and WebSocket communication will always go through the TCP/IP layer. 
 
3, The transmitted data can be anything when using directly Socket API to get connection and to transmit data, for example, when sending HTTP protocol GET requests,  you will receive a bunch of strings whose content is http protocol-related request string if the server uses a listening socket API.
 
4, In the same way, the WebSocket also transmits date through TCP/IP, but there are some differences during establishing connection of WebSocket .
 
5.Webstocket establish the connection by handshake with the server via http protocol first, then the sever resolve the appropriate protocol, confirming whether the connection is HTTP or WebSocket. If it is WebSocket connection, double-ended directly access to the TCP/IP regular three-way handshake stage, and then the connection have established , starting two-way date communication , the same as Socket communication.
 
6, As described on above, when using WebSocket to do long connection and conduct two-way communication, the sever needs to resolve the WebSocket agreement to establish a connection on the browser. If only using Socket
API to receive date, then it needs to resolve the WebSocket agreement by itself.
 
7, Nowadays there are WebSocket third-party libraries by different kinds of languages , such as libwebsocket.org based on C, Socket.io Based on the Node. Js, WebSocket++Based on the c + + , ws4py Based on the Python and also Apache, Nginx, lighttpd has a corresponding WebSocket library.
  查看全部

For these three concepts, many people do not know them clearly. Here as below we give a simple introduce, and then you can search more details on the internet by yourself. 
1, HTTP and WebSocket each is an application layer protocol, TCP/IP is a network layer and transport layer protocol, Socket is a TCP/IP protocol abstraction layer API package. 
 
2, HTTP-get, post requests and WebSocket communication will always go through the TCP/IP layer. 
 
3, The transmitted data can be anything when using directly Socket API to get connection and to transmit data, for example, when sending HTTP protocol GET requests,  you will receive a bunch of strings whose content is http protocol-related request string if the server uses a listening socket API.
 
4, In the same way, the WebSocket also transmits date through TCP/IP, but there are some differences during establishing connection of WebSocket .
 
5.Webstocket establish the connection by handshake with the server via http protocol first, then the sever resolve the appropriate protocol, confirming whether the connection is HTTP or WebSocket. If it is WebSocket connection, double-ended directly access to the TCP/IP regular three-way handshake stage, and then the connection have established , starting two-way date communication , the same as Socket communication.
 
6, As described on above, when using WebSocket to do long connection and conduct two-way communication, the sever needs to resolve the WebSocket agreement to establish a connection on the browser. If only using Socket
API to receive date, then it needs to resolve the WebSocket agreement by itself.
 
7, Nowadays there are WebSocket third-party libraries by different kinds of languages , such as libwebsocket.org based on C, Socket.io Based on the Node. Js, WebSocket++Based on the c + + , ws4py Based on the Python and also Apache, Nginx, lighttpd has a corresponding WebSocket library.