Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create multiple layer images using Raphael canvas library?

Does anyone know how to make multiple drawing layers using Raphael? Here's an example that uses a plain canvas object:

http://html5.litten.com/using-multiple-html5-canvases-as-layers/

like image 649
MichaelT Avatar asked Dec 02 '25 16:12

MichaelT


1 Answers

You can use the same method as they used with canvas.

Create div elements in the html code, give each a distinct id. You can initialize Raphael on an existing element by using paper=new Raphael('elementId',width,height).

This makes is possible to apply css rules to the elements. Set the css just like in the article:

Apply position: absolute; to all elements and use z-index to stack the elements in the order you want.

CSS positioning

like image 169
Wikeno Avatar answered Dec 04 '25 06:12

Wikeno



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!