效果 核心代码 public Region DrawingCircle(Rectangle r) { GraphicsPath gp = new GraphicsPath(); gp.AddEllipse(r); Region region = new Region(gp); return region; } demo 下载:https://download.csdn.net/download/u011392711/11144097…
注意事项:裁剪内容要用Sprite,不能换成ImageView 注意事项: 1.后面测试发现,ImageView也能用,注意换成ImageView时,前缀是ccui. 2.要做圆形头像,用一张圆形图做遮罩 local imagePath = "res/base.png" local maskPath = "res/Mask.png" local clippingNode = cc.ClippingNode:create() local im = cc.Sprite:…