Ruby on Rails
JavaScript, XHTML, CSS
Java, Distributed Systems
<you_name_it>
Image plugin with x/y postion option
Submitted by welshy1984 on Sun, 08/01/2010 - 13:49
I have modified the 'image' plugin to allow x/y positioning of the image.
$.registerLiquidCanvasPlugin({
name: "image",
defaultOpts: { url:"http://www.ruzee.com/files/liquid-canvas-image.png", xPos:0, yPos:0 },
paint: function(area) {
var image = new Image();
image.src = this.opts.url;
image.onload = function() {
area.ctx.drawImage(this, this.opts.xPos, this.opts.yPos);
};
}
});
...you can now use it as such...
image{ url:'path/to/image.png'; xPos:20; yPos:5 }
Trackback URL for this post:
http://www.ruzee.com/trackback/302
