如果文本的宽度 小于 给出的限定宽度,则不滚动直接返回Label
否则使用ClippingNode 实现在指定宽度与高度的矩形内滚动Label.
返回值是Node 直接 addChild使用即可
// 自动根据文本的宽度稳定滚动速率
text.width/width*5
/**
* 创建滚动字幕
* @param txt
* @param fontsize
* @param {cc.Color|null} color
* @param width
* @param height
* @returns {cc.Node|*}
*/
createClipRoundText = function(txt,fontsize,color,width,height){
var text = new cc.LabelTTF(txt,"Arial",fontsize);
console.log('text width:'+text.width);
text.setColor(color?color:cc.colo