开发者

In Cocos2d, how to create a layer that I can set its area size, and only its children that belongs in this area will be shown?

开发者 https://www.devze.com 2023-03-24 07:18 出处:网络
Currently, no matter how big the layer is, when I add a child sprite to it, the sprite will be shown on the screen开发者_如何学C. But if I want to restrict the visible area of the layer and only show

Currently, no matter how big the layer is, when I add a child sprite to it, the sprite will be shown on the screen开发者_如何学C. But if I want to restrict the visible area of the layer and only show children that is inside this area, how can I do it?


You should give ClippingNode a go here: http://www.learn-cocos2d.com/2011/01/cocos2d-gem-clippingnode/

0

精彩评论

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