Closed CSI68 closed 11 years ago
A layer is creating new canvas element. This is expected behaviors. You should carefully read http://www.html5canvastutorials.com/kineticjs/html5-canvas-layer-management-with-kineticjs/
Oups, sorry for that. Thanks lavrton for your answer I will that.
Hello,
For my project I've done a class with KinteticJS to add some element on my canvas. All seems working good but one thing is strange, when I add a text, an image or rect the script add a new canvas. So after adding 3 texts my html contain 3 canvas ... Not so good.
Here is my class:
jQuery.fn.customize = function (callback) { $.customize(this, callback); return this; }; jQuery.customize = function (container, callback) { var container = $(container).get(0); return container.customize || (container.customize = new jQuery._customize(container, callback)); }
jQuery._customize = function (container, callback) { // Store customize object var cust = this; var currentEl=false;
}
Here a sample call code :
// Initialize engine on main container var customize=$.customize('#main-container'); customize.setImage('hunawihr-hdr.jpg');
I think it's not a bug in Kinetic but I bug in my code !
Thanks for your help.
Best regards,
Clement