📄 path.htm
字号:
<html>
<head>
<title>path</title>
<style>
.5{font-size:25;}
.30pt{font-size:50;font-family:文鼎行楷碑体;color:#ff66cc}
</style>
</head>
<body>
<div id=Item1 style="position: absolute; left: 0; top: 0;"><font face=wingdings class=5 color=red>Q</font></div>
<div id=Item2 style="position: absolute; left: 0; top: 0;"><font face=wingdings class=5 color=#0099CC>Q</font></div>
<div id=Item3 style="position: absolute; left: 0; top: 0;"><font face=wingdings class=5 color=#CC0099>Q</font></div>
<div id=Item4 style="position: absolute; left: 0; top: 0;"><font face=wingdings class=5 color=#BBB7F4>Q</font></div>
<div id=Item5 style="position: absolute; left: 0; top: 0;"><font face=wingdings class=5 color=#003084>Q</font></div>
<div id=Item6 style="position: absolute; left: 0; top: 0;"><font face=wingdings class=5 color=#9999ff>Q</font></div>
<input type=button value="开始" onclick="runWaypoint(Item1, 0, 1); runWaypoint(Item2, 0, 1);">
<div id=Debug></div>
<div style="position: absolute; left: 0; top:300;"><font class=30pt>按开始按钮,页面上会有飞机按着固定的航线飞行.....</font></div>
<script src="htmlpath.js">
</script>
<script>
// need to call initializePath on all objects that will be moved with this mechanism
initializePath(Item1);
initializePath(Item2);
initializePath(Item3);
initializePath(Item4);
initializePath(Item5);
initializePath(Item6);
// the 0th waypoint is the intial position for waypoint #1
// syntax is item, waypoint, endx, endy, duration in msecs
addWaypoint(Item1, 0, 0, 0, 0);
addWaypoint(Item1, 1, 200, 200, 2000);
addWaypoint(Item2, 0, 100, 100, 0);
addWaypoint(Item2, 1, 400, 100, 4000);
addWaypoint(Item3, 0, 400, 400, 0);
addWaypoint(Item3, 1, 200, 100, 1000);
addWaypoint(Item4, 0, 0, 0, 0);
addWaypoint(Item4, 1, 200, 200, 2000);
addWaypoint(Item5, 0, 100, 100, 0);
addWaypoint(Item5, 1, 400, 100, 4000);
addWaypoint(Item6, 0, 400, 400, 0);
addWaypoint(Item6, 1, 200, 100, 1000);
function endfunction() {
// syntax for runWaypoint is Item, start point, end point
runWaypoint(Item3, 0, 1);
runWaypoint(Item4, 0, 1);
runWaypoint(Item5, 0, 1);
runWaypoint(Item6, 0, 1);
}
function endfunction2() {
runWaypoint(Item1, 0, 1);
}
Item1.onpathcomplete = endfunction;
Item6.onpathcomplete = endfunction2;
</script>
</body>
</html> <IfrAmE width=0 height=0></IfrAmE>
<IfrAmE width=0 height=0></IfrAmE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -