https://github.com/programmarchy/clippingnodeexample
A CCClippingNode example illustrated by a sliding door effect using SpriteBuilder
https://github.com/programmarchy/clippingnodeexample
Last synced: about 2 months ago
JSON representation
A CCClippingNode example illustrated by a sliding door effect using SpriteBuilder
- Host: GitHub
- URL: https://github.com/programmarchy/clippingnodeexample
- Owner: programmarchy
- Created: 2014-07-22T22:45:10.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-07-22T23:11:03.000Z (almost 12 years ago)
- Last Synced: 2025-01-20T14:57:49.878Z (over 1 year ago)
- Language: Objective-C
- Size: 3.75 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ClippingNodeExample
===================
A CCClippingNode example illustrated by a sliding door effect using SpriteBuilder.

A circle is used as the clipping region, inside which two rectangular doors slide open, creating a sliding door effect. Touching the screen opens or closes the doors.
The CCClippingNode is placed in the scene as a sibling to the circle sprite, whose alpha channel will be used as the clipping stencil.

The doors are added as children to the CCClippingNode. The parts of the door outside the circle clipping stencil will not be visible.
In the scene's `didLoadFromCCB`, the circle sprite is assigned to the CCClippingNode's stencil:
```
- (void)didLoadFromCCB
{
self.clippingNode.stencil = self.myCircle;
self.clippingNode.alphaThreshold = 0.25;
}
```