要写一个直上直下的进度条 需要用progress 还是 loadingbar
哪个效果更好
progresstimer 可以实现 直上直下的吗?
要写一个直上直下的进度条 需要用progress 还是 loadingbar
哪个效果更好
progresstimer 可以实现 直上直下的吗?
用loadingbar
loadingbar 只有ccui.LoadingBar.TYPE_LEFT = 0; 和 ccui.LoadingBar.TYPE_RIGHT = 1;没有上和下的
是的,暂时没有上下功能。
需求已反馈给开发组。
setDirection: function (dir) {
if (this._direction == dir)
return;
this._direction = dir;
switch (this._direction) {
case ccui.LoadingBar.TYPE_LEFT:
this._barRenderer.setAnchorPoint(0, 0.5);
this._barRenderer.setPosition(0, this._contentSize.height0.5);
if (!this._scale9Enabled)
this._barRenderer.setFlippedX(false);
break;
case ccui.LoadingBar.TYPE_RIGHT:
this._barRenderer.setAnchorPoint(1, 0.5);
this._barRenderer.setPosition(this._totalLength,this._contentSize.height0.5);
if (!this._scale9Enabled)
this._barRenderer.setFlippedX(true);
break;
}
}, 要是在这里 改 也轻易不敢动啊。
尝试翻转一下吧
好 吧
setDirection: function (dir) {
if (this._direction == dir)
return;
this._direction = dir;
switch (this._direction) {
case ccui.LoadingBar.TYPE_LEFT:
this._barRenderer.setAnchorPoint(0, 0.5);
this._barRenderer.setPosition(0, this._contentSize.height0.5);
if (!this._scale9Enabled)
this._barRenderer.setFlippedX(false);
break;
case ccui.LoadingBar.TYPE_RIGHT:
this._barRenderer.setAnchorPoint(1, 0.5);
this._barRenderer.setPosition(this._totalLength,this._contentSize.height0.5);
if (!this._scale9Enabled)
this._barRenderer.setFlippedX(true);
break;
case ccui.LoadingBar.TYPE_UP:
this._barRenderer.setAnchorPoint(0.5, 0);
this._barRenderer.setPosition(this._totalLength0.5,0);
if (!this._scale9Enabled)
this._barRenderer.setFlippedY(false);
break;
case ccui.LoadingBar.TYPE_DOWN:
this._barRenderer.setAnchorPoint(0.5, 1);
this._barRenderer.setPosition(this._totalLength0.5,this._contentSize.height);
if (!this._scale9Enabled)
this._barRenderer.setFlippedY(true);
break;
}
}, 没成功!!~~~

bar:setRotation(90)