- extended canvas for gamedevelopers
- easy setup for a game loop, rendering loop, mouse, touch and keyboard
cq(640, 480)
..drawImage(image, 0, 0)
..fillStyle('#ff0000')
..fillRect(64, 64, 32, 32)
..blur()
..appendTo(query('body'));
cq(canvas);
cq(image);
cq('#canvas');
cq('.image');
cq(320, 240);
cq();
- CqWrapper supports all CanvasRenderingContext2D methods and properties by using noSuchMethod.
You can still access the original context and canvas element
cq('#something').canvas;
cq('#something').context;
Any change done to the wrapper will be applied to the original provided (or created) canvas element. Whenever you want to break the chain reaction and get a fresh copy use .clone() method:
var clone = cq().clone()..setHsl(...);
If you want to insert your canvas to the document body use the .appendTo() method:
cq(320, 240)..fillStyle = '#00ff00'
..fill(0, 0)
..appendTo(query('body'));
If you have any question ask them here
- Przemyslaw Sikorski / rezoner for creating the original javascript version of CanvasQuery