HTML5 Canvas compositing question (source-in)
- by Alex Ciarlillo
I am trying to recreate a page flipping type animation in HTML5 using canvas. The animation is based on ideas from here: hxxp://oreilly.com/javascript/archive/flashhacks.html but thats not really important. The problem I am having is that using the 'source-in' composite operation is not giving me the results I expect and would like clarification as to why. Here is the example: (i think it can only be viewed in chrome, not working in FF 3.6)
http://acpound.fylez.com/test/example.html
The black rectangle is supposed to act as a 'mask' for the page being turned over. All I want to see is the turning page in the areas where it overlaps the mask. The problem is the entire black rectangle is drawn, not just the area where they overlap.
The source is all on the page.
I know HTML5 isn't really being used yet, I'm just experimenting for my personal site and curiosity. Any ideas would be greatly appreciated.