求vbscript网页游戏的资料或示例

MMICE 2013-09-30 06:37:45
因为本人只会vb,写的程序也只需要在windows下运行,所以想求点用vb做网页编程(特别是和HTML5有关的)的资料,尤其是在IE网页中运行的。
...全文
245 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
MMICE 2013-09-30
  • 打赏
  • 举报
回复
谢谢解答,学习了。。。
bcrun 2013-09-30
  • 打赏
  • 举报
回复
这可不容易,现在的客户端页面开发资料大多是javascript的,如果不是从头自己研发的话,不会js的人可不容易改写为js的。而且很多js库代码不少,两种语言的差异又很大,想翻译也很困难。 不过,如要求不高的话,比如只是使用基于对象编程的思想,使用现成的已被前人证实可用的一些对象来实现自己的普通需求,还是可以搞一下的。由于时间限制,这里只拿一个网上找到的在HTML5元素canvas里画图的js例子,改成vbs的,效果一样。你自己可以参考理解一下语法的差异。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
    <meta http-equiv="X-UA-Compatible" content="IE=100"> <!-- ie8 mode -->
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title> New Document </title>
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

<body onload1="BodyOnLoadVb()">
		<canvas style="width:300px;height:300px;" id="myCanvas" width="300" height="300" >  </canvas>
		<canvas style="width:300px;height:300px;" id="myCanvasVb" width="300" height="300" >  </canvas>
  
 </body>
<script type="text/javascript">
<!--
	function BodyOnLoad(){
		var canvas=document.getElementById('myCanvas');
		var ctx= canvas.getContext('2d');
		ctx.fillStyle="#99FF66";
		ctx.fillRect(10,10,15,80);
		ctx.fillStyle="#99FF66";
		ctx.fillRect(60,10,15,80);
		ctx.fillStyle="#0033CC";
		ctx.fillRect(26,27,33,50);
		ctx.fillStyle="red";
		ctx.beginPath();
		ctx.arc(43,52,17,0,Math.PI*2,true);
		ctx.closePath();
		ctx.fill();
		ctx.strokeStyle="#CCCC00";
		ctx.lineWidth=2;
		ctx.moveTo(43,52);
		ctx.lineTo(43,10);
		ctx.stroke();
	}
	BodyOnLoad()
//-->
</script>
<script type="text/vbscript">
<!--
	function BodyOnLoadVb()
		Dim canvas
		Set canvas=document.getElementById("myCanvasVb")
		Dim ctx
		Set ctx = canvas.getContext("2d")
		ctx.fillStyle="#99FF66"
		Call ctx.fillRect(10,10,15,80)
		ctx.fillStyle="#99FF66"
		Call ctx.fillRect(60,10,15,80)
		ctx.fillStyle="#0033CC"
		Call ctx.fillRect(26,27,33,50)
		ctx.fillStyle="red"
		call ctx.beginPath()
		call ctx.arc(43,52,17,0,Math.PI*2,true)
		call ctx.closePath()
		call ctx.fill()
		ctx.strokeStyle="#CCCC00"
		ctx.lineWidth=2
		call ctx.moveTo(43,52)
		call ctx.lineTo(43,10)
		call ctx.stroke()
		'msgbox typename(ctx)

	End Function
	call BodyOnLoadVb()
//-->
</script> </html>

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧