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
// pattern
4
var pattern = stage.pattern(new acgraph.math.Rect(0,0,20,20));
5
6
pattern.circle(10, 10, 8).fill("none").stroke("1 blue 0.9");
7
pattern.star5(10, 10, 6).fill("1 blue 0.9");
8
9
// create shapes and fill with pattern
10
stage.rect(0, 0, 150, 50).fill(pattern);
11
stage.circle(150, 150, 50).fill(pattern);