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(120, 50, 100, 100);
4
rectangle.fill('#90CAF9');
5
rectangle.rotate(31, 120, 50);
6
7
// Gets the rotation angle.
8
var angle = rectangle.getRotationAngle();
9
10
var simpleText = stage.text();
11
simpleText.x(60);
12
simpleText.y(30);
13
simpleText.text('Rotation angle is ' + angle);
14
simpleText.fontSize(12);