This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var item = CANVAS.layers.get('myLayer').get(coin); | |
new Cmorph(item, { | |
duration: 5000, | |
transition: 'back:in:out', | |
}).morph({ | |
scale : -1 | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//MooTools Canvas Lib. Copyright (c) 2010 Martin Tillmann, <http://forvar.de/js/mcl>, MIT Style License.(corrected error in calling the ID) | |
(function(){var a=this.CANVAS={layers:[],ctx:null,ctxEl:null,lastMouseOverTarget:null,dragTarget:null,threads:null,ctxPos:null,cacheCtxPos:false,init:function(b){if(b.canvasElement){this.setCtx(b.canvasElement)}this.layers=new LayerHash();if(b.enableMouse){this.setupMouse()}if(b.cacheCtxPos){this.cacheCtxPos=this.options.cacheCtxPos}this.threads=new Hash();this.ctxPos=$(this.ctxEl).getPosition();return this},setDrag:function(b){this.dragTarget=b.fullid},clearDrag:function(){this.dragTarget=null},getMouse:function(c){var b=this.cacheCtxPos?this.ctxPos:$(this.ctxEl).getPosition();return[c.event.pageX-b.x,c.event.pageY-b.y]},setupMouse:function(){$(this.ctxEl).addEvents({click:function(c){var b=a.getMouse(c);if(item=a.findTarget(b)){item.fireEvent("click",b)}},mousedown:function(c){var b=a.getMouse(c);if(a.dragTarget){a.fromPath(a.dragTarget).fireEvent("mousedown",b);return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//MooTools Canvas Lib. Copyright (c) 2010 Martin Tillmann, <http://forvar.de/js/mcl>, MIT Style License.(corrected error in calling the ID) | |
(function(){var a=this.CANVAS={layers:[],ctx:null,ctxEl:null,lastMouseOverTarget:null,dragTarget:null,threads:null,ctxPos:null,cacheCtxPos:false,init:function(b){if(b.canvasElement){this.setCtx(b.canvasElement)}this.layers=new LayerHash();if(b.enableMouse){this.setupMouse()}if(b.cacheCtxPos){this.cacheCtxPos=this.options.cacheCtxPos}this.threads=new Hash();this.ctxPos=$(this.ctxEl).getPosition();return this},setDrag:function(b){this.dragTarget=b.fullid},clearDrag:function(){this.dragTarget=null},getMouse:function(c){var b=this.cacheCtxPos?this.ctxPos:$(this.ctxEl).getPosition();return[c.event.pageX-b.x,c.event.pageY-b.y]},setupMouse:function(){$(this.ctxEl).addEvents({click:function(c){var b=a.getMouse(c);if(item=a.findTarget(b)){item.fireEvent("click",b)}},mousedown:function(c){var b=a.getMouse(c);if(a.dragTarget){a.fromPath(a.dragTarget).fireEvent("mousedown",b);return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).addEvent('load',function(){ | |
CANVAS.init({ canvasElement : 'canvas' }); | |
// setting the lineWidth globally | |
CANVAS.ctx.lineWidth = 0.5; | |
/* you can add a CanvasItem to a new Layer instantly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// packager build Custom-Event/* Mobile/* Class-Extras/* History/* DynamicMatcher/* EventStack/* Form-AutoGrow/* Form-Placeholder/* Tree/* ScrollLoader/* Interface/* | |
/* | |
--- | |
name: Element.defineCustomEvent | |
description: Allows to create custom events based on other custom events. | |
authors: Christoph Pojer (@cpojer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//MooTools Canvas Lib. Copyright (c) 2010 Martin Tillmann, <http://forvar.de/js/mcl>, MIT Style License.(corrected error in calling the ID) | |
(function(){var a=this.CANVAS={layers:[],ctx:null,ctxEl:null,lastMouseOverTarget:null,dragTarget:null,threads:null,ctxPos:null,cacheCtxPos:true,init:function(b){if(b.canvasElement){this.setCtx(b.canvasElement)}this.layers=new LayerHash();if(b.enableMouse){this.setupMouse()}if(b.cacheCtxPos){this.cacheCtxPos=this.options.cacheCtxPos}this.threads=new Hash();this.ctxPos=$(this.ctxEl).getPosition();return this},setDrag:function(b){this.dragTarget=b.fullid},clearDrag:function(){this.dragTarget=null},getMouse:function(c){var b=this.cacheCtxPos?this.ctxPos:$(this.ctxEl).getPosition();return[c.event.pageX-b.x,c.event.pageY-b.y]},setupMouse:function(){$(this.ctxEl).addEvents({click:function(c){var b=a.getMouse(c);if(item=a.findTarget(b)){item.fireEvent("click",b)}},mousedown:function(c){var b=a.getMouse(c);if(a.dragTarget){a.fromPath(a.dragTarget).fireEvent("mousedown",b);return} |