-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest4.html
More file actions
65 lines (46 loc) · 1.1 KB
/
Copy pathtest4.html
File metadata and controls
65 lines (46 loc) · 1.1 KB
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
<html>
<head>
<script src="./screen.js"></script>
</head>
<style>
body{ padding:0; margin:0; background:#cccccc; width:100%; height:100%; overflow:hidden; }
</style>
<center><canvas style="border:1px solid #cecece; margin:10px; cursor:cross;" width="480px" height="600px" id="screen"> </canvas></center>
<script>
var monitor, gui = graphicalUserInterface( ( monitor = {
width: 480, height:600,
monitor: document.getElementById('screen'),
modulo:!1,
} ) ).resetScreen( 0x000000 ).refresh( );
var img, lines;
(img = (new Image( ) ) ).src="./tiles/test.jpg";
img.onload = function( ){
gui.resize(
img.width,
img.height
);
lines = ( new Array( img.width * img.height ) ).fill(
0x000000
);
gui.drawImage( img );
test( );
gui.refresh( );
};
function test( ){
var i = 0;
while( i < gui.screen_y ){
( !!(i%2) === monitor.modulo ) ?
gui.setLine(
i, lines, true
) :void 0;
i++;
}
}
setInterval(function( ){
gui.drawImage( img );
monitor.modulo = !monitor.modulo;
test( );
gui.refresh( );
},30);
</script>
</html>