本帖最后由 灯笼菜刀王 于 2022-2-27 23:57 编辑 我知道两点之间的距离公式 √((x1-x2)^2 + (y1-y2)^2 但是以该值作为宽度 m = Math.sqrt((x1 - x2).abs^2 + (y1 - y2).abs^2) 描绘线条 ...
查看全部评分
x,y = 111,333 back = RPG::Sprite.new back.bitmap = Bitmap.new(640,480) back.bitmap.fill_rect(0,0,640,480,Color.new(0,0,0)) a = RPG::Sprite.new b = RPG::Sprite.new c = RPG::Sprite.new aaa = Bitmap.new(10,10) aaa.fill_rect(0,0,10,10,Color.new(255,0,255)) bbb = Bitmap.new(10,10) bbb.fill_rect(0,0,10,10,Color.new(0,255,255)) a.bitmap = aaa b.bitmap = bbb a.x = 320 a.y = 240 b.x = x b.y = y c.x = 320 c.y = 240 m = Math.sqrt((x - 320)**2 + (y - 240)**2) c.bitmap = Bitmap.new(m,1) c.bitmap.fill_rect(0,0,m,1,Color.new(255,255,255)) d = Math.atan2( (240 - y), (x - 320)) / Math::PI * 180 c.angle = d
捕获.PNG (5.29 KB, 下载次数: 17)
下载附件 保存到相册
2022-2-28 01:09 上传
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-22 18:49
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.