masking/ overflow
Hi,
I wonder if we can use masking to show objects in certain area like in flash or overflow css. Let's say when the object is within a recangle area, it'll be visible to the screen, but when it goes outside the rectangle, it'll become hidden. If only a part /half goes out of rectangle, then the only visible part is the one inside the rectangle.
I think we have linear filling like in this tutorial
http://www.html5canvastutorials.com/kineticjs/html5-canvas-set-fill-with-kineticjs/
But i'm wondering whether we put objects and animate it inside the fill.
Thanks
I've had several requests to provide some sort of clipping functionality that would do exactly what you're asking for - I'll add it to my todo list :)
Thanks!
I actually have group clipping working, at least as much as I need it to. Since the forums have been removed, I can't post code there or provide a plugin, but I do have the code to do this. And I'm not very familiar with github so I'm not sure how to submit code for review and inclusion.
The code I have isn't true group clipping since groups don't have a width or height, but my code includes the creating of a clipping rectangle to "define" the group's width and height, and includes the ability to clip a group within the clip group. The only issue with this is that the shapes must be moved, instead of moving the group. I have code to do that as well though.
Let me know if you want to review the code, and perhaps I'll look around here and figure out how to commit code.
Wow that would be great. I'm not familiar with github as well so it would be nice if you can deliver it somwhow.. Thanks
It'll be in the next release:
https://github.com/ericdrowell/KineticJS/wiki/Release-Schedule
"container clipping function"
Follow up - Clipping regions are now fully supported as of v4.4.0
https://github.com/ericdrowell/KineticJS/wiki/Change-Log#440-mar-26-2013
This plugin seriously need better clipping techniques -- specially for custom shapes.