HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
var stage = acgraph.create('container');
2
3
var rectangle = stage.rect(20, 20, 100, 100);
4
rectangle.fill('#80CBC4');
5
rectangle.clip(stage.createClip());
6
7
var clipArea = rectangle.clip();
8
9
// Sets shape to the clip.
10
clipArea.shape(50, 50, 60, 60);
11
// Same as [50, 50, 60, 60] or {left: 50, top: 50, width: 60, height: 60}.