开发者

Using a CCLayer as a progress bar

开发者 https://www.devze.com 2023-03-23 07:18 出处:网络
How does one display a CCLayer in cocos2d but maki开发者_开发知识库ng it appear as a progress bar in the sense that the layer should appear from the left and extend to the right until it is fully show

How does one display a CCLayer in cocos2d but maki开发者_开发知识库ng it appear as a progress bar in the sense that the layer should appear from the left and extend to the right until it is fully shown?

Can this be done using a series of images and setting the CCLayer to them in a sequence, if so, how is this done in cocos2d?

Are there any other ways of doing it?

Thanks


You can set the position of the layer out of the screen bounds, then perform a CCMoveTo action. Something like:

[layer runAction:[CCMoveTo actionWithDuration:time position:pos]];

where pos is the position inside the screen bounds

0

精彩评论

暂无评论...
验证码 换一张
取 消