-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest2.html
More file actions
47 lines (32 loc) · 954 Bytes
/
Copy pathtest2.html
File metadata and controls
47 lines (32 loc) · 954 Bytes
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
<html>
<head>
<script src="./screen.js"></script>
</head>
<style>
body{ padding:0; margin:0; background:#cccccc; width:100%; height:100%; overflow:hidden; }
</style>
<input type='number' value="8" min="8" id="hdl1" >
<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:8,
} ) ).resetScreen( 0x000000 ).refresh( );
document.getElementById('hdl1').onchange = function( ){
gui.resetScreen( 0x000000 );
this.value = monitor.modulo = ( monitor.modulo = parseInt( this.value ) );
test( );
};
function test( ){
gui.each(function( addr ){
!(addr%monitor.modulo) ?
this.setRawPixel(
addr*4 ,
0x5555AA
) : void 0;
}).refresh( );
}
test( );
</script>
</html>