#마스크 적용(타임 바 만들기)
@세팅
this.bar = cc.Sprite.create(game_timebar);
this.addChild(this.bar);
this.bar.setAnchorPoint(cc.p(0, 0.5));
this.barSize = this.bar.getContentSize();
this.bar.setTextureRect(cc.RectMake(0, 0, this.barSize.width, this.barSize.height));
@업데이트
var barW = this.barSize.width - (경과 시간 / 전체 시간 * this.barSize.width);
if(barW <= this.barSize.width)
{
this.bar.setTextureRect(cc.RectMake(0, 0, barW, this.barSize.height));
}
*sprite 사이즈 보다 rect 가 클 경우 화면에 안 보인다.