mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
bc2729683c
- Symbol -> SymbolDefinition - PlacedSymbol -> SymbolItem - Symbol#definition -> SymbolDefinition#item - PlacedSymbol#symbol -> SymbolItem#definition - Deprecate Project#symbols Closes #770
34 lines
1 KiB
HTML
34 lines
1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Gradients</title>
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
<script type="text/javascript" src="../../dist/paper-full.js"></script>
|
|
<script type="text/paperscript" canvas="canvas1">
|
|
var path = new Path.Circle({
|
|
center: view.center,
|
|
radius: view.bounds.height * 0.4
|
|
});
|
|
path.fillColor = {
|
|
stops: ['yellow', 'red', 'black'],
|
|
radial: true,
|
|
origin: path.position,
|
|
destination: path.bounds.rightCenter
|
|
}
|
|
|
|
var symbol = new SymbolDefinition(path);
|
|
symbol.place(view.center);
|
|
|
|
window._json = project.exportJSON();
|
|
console.log(window._json);
|
|
</script>
|
|
<script type="text/paperscript" canvas="canvas2">
|
|
project.importJSON(window._json);
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas1" width="500" height="500"></canvas>
|
|
<canvas id="canvas2" width="500" height="500"></canvas>
|
|
</body>
|
|
</html>
|