mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Implement loading Rasters from external sources and notify using a 'load' callback.
This commit is contained in:
parent
1e744e3db7
commit
373474d088
3 changed files with 37 additions and 4 deletions
|
@ -7,7 +7,13 @@
|
|||
<script type="text/javascript" src="../../dist/paper.js"></script>
|
||||
<script type="text/paperscript" canvas="canvas">
|
||||
// http://en.wikipedia.org/wiki/Lenna
|
||||
var raster = new Raster('lenna');
|
||||
// Load from Server:
|
||||
var raster = new Raster('http://upload.wikimedia.org/wikipedia/zh/3/34/Lenna.jpg');
|
||||
// Load from DOM image:
|
||||
// var raster = new Raster('lenna');
|
||||
raster.onLoad = function() {
|
||||
console.log('Successfully loaded image!');
|
||||
};
|
||||
var lastScale = 1;
|
||||
var center = view.center;
|
||||
function onFrame(event) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue