Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我找不到像在 cocos2d-x 中那样在 cocos2d-js 中用独特颜色填充图层的方法。
如果你做到了,请分享方法。
提前致谢
您可以简单地创建一个cc.LayerColor具有特定颜色的实例。您提供的颜色将填充整个图层。
cc.LayerColor
例如。创建一个红色纯色图层:
var winSize = cc.winSize; var colorLayer = new cc.LayerColor(cc.color(255,0,0), 200,200); colorLayer.setPosition(cc.p(100,100)); this.addChild(colorLayer);