Discussion Forums > Technology

Need some kind of constant motion.

(1/4) > >>

nstgc:
I need something to display a constant, predictable, uniformed motion. Ideally a bouncing white black that moves around a screen. There is a Java program that does that. I'm checking for a specific problem. My new monitor seems to be a bit jerky. Its not the video card, and xShadow isn't have trouble with it. Google also doesn't enlighten me any aside from informing me that no one else seems to have this problem. Given that I do have a used monitor, it doesn't seem too far fetched to think that there may be something wrong.

billlanam:
You can check your monitor with another computer, to see if the monitor is at fault.

There are screen savers that do constant motion.

K7IA:
a simple javascript could do the trick as well...

<html><body><div>

div as a whitebox with your desired dimensions, body with a black background (or vice versa)

move it along the x for every y with a simple timer or a mouse/keyboard event

run the code on browser in fullscreen.

... you got a very simple testing tool

nstgc:
I don't know Java and am not interested at this time to learn it. Maybe I can ask someone who does know Java to write a script like that.

K7IA:
^ sure  ;) just save it an .html and open it with your browser.


--- Code: ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script type="text/javascript">
function move(i)
{
var box = document.getElementById("box");
var o = {interval: 20, step: 5}
o.x = Math.floor(window.innerWidth / o.step);
o.y = Math.floor(window.innerHeight / box.clientHeight);

box.style.left = (i % o.x) * o.step;
box.style.top = (Math.floor(i / o.x) % o.y) * box.clientHeight;

setTimeout("move(" + (i + 1) +")", o.interval);
}
</script>
<style>
#box {width: 50px; height: 50px; position: fixed; display: block; background-color: white;}
body {background-color: black;}
</style>
</head>
<body onload="move(0);">
<div id="box"></div>
</body>
</html>
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version