Project1

标题: 如何进行位图的移动与旋转 [打印本页]

作者: 1370528656    时间: 2012-3-24 13:35
标题: 如何进行位图的移动与旋转
如题,我用脚本显示位图(Bitmap.new)后,用怎样的语句才能使位图进行移动或旋转?dsu_plus_rewardpost_czw
作者: Wind2010    时间: 2012-3-24 15:57
一般都是先生成个Sprite的Bitmap然后通过对Sprite的x y z angle来对Bitmap“操作”的
作者: 1370528656    时间: 2012-3-24 18:51
Wind2010 发表于 2012-3-24 15:57
一般都是先生成个Sprite的Bitmap然后通过对Sprite的x y z angle来对Bitmap“操作”的 ...

Bitmap移动能显示轨迹吗(无残影)?还有旋转呢?
作者: Wind2010    时间: 2012-3-24 19:11
1370528656 发表于 2012-3-24 18:51
Bitmap移动能显示轨迹吗(无残影)?还有旋转呢?

Bitmap本身不能做到,但是如果先生成一个Sprite,再定义Sprite里的Bitmap,就能通过修改Sprite的angle数值来让Bitmap旋转
作者: end55rpg    时间: 2012-3-24 21:13
wait for me!
让我去做个脚本,20分钟后见
作者: Wind2010    时间: 2012-3-25 15:19
  1. text = Sprite.new
  2. text.bitmap = Bitmap.new("Graphics/Icons/001-Weapon01")
  3. text.ox,text.oy = text.bitmap.rect.width/2,text.bitmap.rect.height/2
  4. loop do
  5.   Graphics.update
  6.   Input.update
  7.   if Input.repeat?(Input::LEFT) then text.x -= 1 end
  8.   if Input.repeat?(Input::RIGHT) then text.x += 1 end
  9.   if Input.repeat?(Input::UP) then text.angle -= 1 end
  10.   if Input.repeat?(Input::DOWN) then text.angle += 1 end
  11. end
复制代码
未经试验




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1