-
Notifications
You must be signed in to change notification settings - Fork 169
/
Copy path_text.html
52 lines (45 loc) · 1.35 KB
/
_text.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<title>Text</title>
<script src="../dev-lib/sea.js"></script>
<script>
seajs.config({
base: '../src'
});
define('start', function (require) {
var Paper = require('graphic/paper');
var Rect = require('graphic/rect');
var Group = require('graphic/group');
var Color = require('graphic/color');
var Text = require('graphic/text');
var Circle = require('graphic/circle');
var utils = require('core/utils');
var paper = new Paper(document.body);
window.t = new Text();
paper.addShape(t);
var rb = new Rect().stroke('red');
paper.addShape(rb);
window.p = new Circle(1).fill('#00ff00');
paper.addShape(p);
setInterval(function() {
var box = t.getRenderBox('top');
rb.setPosition(box.x, box.y).setSize(box.width, box.height);
}, 15);
t.setContent('this is a test').translate(100, 100);
p.translate(100, 100);
});
seajs.use('start');
</script>
<style>
body, div, html {
margin: 0;
padding: 0;
overflow: hidden;
background: #333;
}
</style>
</head>
<body>
</body>
</html>