-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbutton.html
72 lines (48 loc) · 2.9 KB
/
button.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<title>Studio3</title>
<meta name="viewport" content="width=device-width, user-scalable=0, maximum-scale=1"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon" href="icon.png" />
</head>
<body style="margin:0;background: #333">
<canvas id="canvas" height="342" width="512" style="cursor:pointer;margin: 0 auto;display: block;outline:1px solid #BBFF00;"></canvas>
</body>
<script src="studio-compiled.js"></script>
<style>
canvas{image-rendering: -webkit-optimize-contrast;}
</style>
<script>
var stage = new Studio.Stage("canvas",{webgl:0, fullscreen:0, resolution: 1, dur: 1000/1, interpolate: 1});
var textbox = new Studio.TextBox(512,512,stage);
textbox.columns = 3
var everyText = textbox.image
everyText.addSlice({"myBox":{x:64,y:64,width:512-64,height:256}})
textbox.slice = "myBox";
textbox.font.lineHeight = 16
// textbox.setFont('28px Times New Roman')
textbox.shadow = 1
textbox.font.color = 'red'
var textbox2 = new Studio.TextBox(64,64,stage,everyText);
everyText.addSlice({"myBox2":{x:0,y:0,width:64,height:64}})
textbox2.setText("Im a test").finish()
textbox2.slice = "myBox2";
textbox.setText('Hilo world! Lorem ipsum dolor sit amet, ac amet sit lorem, velit quam. Condimentum vitae maecenas tristique ante leo, dui bibendum nam ut, in laoreet, et dui justo, sed vestibulum. Vel vitae sed ac, pellentesque conubia lorem, faucibus fringilla duis quis justo fringilla mauris, nibh sit augue dui, tortor vestibulum euismod a. Tempor sollicitudin in at fusce. Quam ut, enim dignissim vehicula consectetuer, mauris risus nostra, fermentum vel enim leo posuere sed nulla, erat quis tristique. Volutpat consectetuer suspendisse, nec tincidunt pellentesque. Porttitor magna, sit sed eleifend nam ante elit scelerisque, lorem pede proin eros, commodo nulla at sed quis, in faucibus auctor laoreet. Aliquet sapien orci maecenas pharetra, parturient duis praesent mi et ipsum, ac nulla, adipiscing habitasse nullam nullam viverra, feugiat curabitur. Nec commodo ut pulvinar sollicitudin pellentesque, donec in per vulputate id maecenas, tristique in nunc. Dolor et morbi. Id nunc non diam sollicitudin dictum, morbi urna, et ultricies non blandit imperdiet conubia hendrerit, erat pellentesque, nunc amet aliquet in.').finish()
textbox.x = 256;
textbox.y = 256/2;
textbox.width = 512-64
textbox.height = 256
textbox2.x = 256
textbox2.y = 256
stage.addChild(textbox);
stage.addChild(textbox2);
stage.color.setFromHex('#FFFF00')
// Studio.Effect.BillAtkinsonDither_BW.action(textbox.image)
//
Studio.Effect.Blur.init()
// textbox.image.applyEffect(Studio.Effect.Blur)
// stage.addEffect(Studio.Effect.BillAtkinsonDither_BW)
Studio.start();
</script>
</html>