Skip to content
This repository has been archived by the owner. It is now read-only.

CCClippingNode not working on iOS and Mac #97

kjpou1 opened this issue Jan 12, 2015 · 6 comments

CCClippingNode not working on iOS and Mac #97

kjpou1 opened this issue Jan 12, 2015 · 6 comments


Copy link

@kjpou1 kjpou1 commented Jan 12, 2015

This has never worked on iOS or Mac because of missing functionality from the MonoGame side of things. If the functionality is there then it is not working correctly nor the same as for windows.


Copy link
Member Author

@kjpou1 kjpou1 commented Feb 16, 2015

This is also no longer working on Windows.

Copy link
Member Author

@kjpou1 kjpou1 commented Jun 17, 2015

Issue reported here MonoGame/MonoGame#3943

Copy link

@ghost ghost commented Mar 6, 2016

It's not working indeed.

I made a little test, inspired by the code there to make a part of a layer transparent.

C++ version using cocos2d-x

Size visibleSize = Director::getInstance()->getVisibleSize();
Point origin = Director::getInstance()->getVisibleOrigin();
addChild(LayerColor::create(Color4B(122, 144, 0, 255), visibleSize.width, visibleSize.height));

//this is the layer that we want to "cut"
Layer *layer = Layer::create();
Sprite* pSprite = Sprite::create("ball.png");
pSprite->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
layer->addChild(pSprite, 0);

//we need to create a ccnode, which will be a stencil for ccclipingnode, draw node is a good choice for that
DrawNode * stencil = DrawNode::create();
stencil->drawSegment(Vec2(0, 0), Vec2(visibleSize.width, visibleSize.height), 20, Color4F(0, 0, 0, 255));

//CCClipingNode show the intersection of stencil and theirs children
ClippingNode *cliper = ClippingNode::create(stencil);
//you want to hide intersection so we setInverted to true


simulator screen shot 06 mar 2016 09 56 10

C# version using CocosSharp

this.AddChild(new CCLayerColor(new CCSize(1024,768),new CCColor4B(122,144,0,255)));

//this is the layer that we want to "cut"
CCLayer layer = new CCLayer();
CCSprite pSprite = new CCSprite("ball.png");
pSprite.Position = new CCPoint(512, 386);

CCDrawNode stencil = new CCDrawNode();
stencil.DrawSolidCircle(new CCPoint(0, 0), 20, new CCColor4B(0, 0, 0, 255));
stencil.DrawLine(new CCPoint(0,0),new CCPoint(1024, 768),20,new CCColor4B(0, 0, 0, 255));

CCClippingNode cliper = new CCClippingNode(stencil);
cliper.Inverted = true;


simulator screen shot 06 mar 2016 10 09 15

What worries me the most is that it's a more than a year old bug and it's still not fixed...

Copy link

@JuanuMusic JuanuMusic commented Jul 9, 2017

Hey Guys.
I'm on version 1.7.1 (latest as of today) and the CCClippingNode class is still not working.
Any news on this?
Maybe a workaround?

Copy link

@ghost ghost commented Jul 9, 2017

This is the answer I got from miguel de icaza few months ago

Copy link

@vchelaru vchelaru commented Jul 9, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants