Project1
标题: 请问战斗界面如何让敌人显示区域和背景一样大? [打印本页]
作者: adahs 时间: 2019-12-7 23:30
标题: 请问战斗界面如何让敌人显示区域和背景一样大?
本帖最后由 adahs 于 2019-12-7 23:37 编辑
因为用了立绘战斗脚本,用那种要占满整个屏幕的敌人图片的时候下面的边缘就会很违和。请问想让敌人图片占满整个界面的话,要怎么改脚本?
做的是某游戏的同人,这种敌人挺多的。。
作者: KB.Driver 时间: 2019-12-8 01:01
class Sprite_Battler
alias update_position_for_high_enemy update_position
def update_position
update_position_for_high_enemy
if (dec = bitmap.height - 296) > 0 then self.y += dec end
end
end
class Sprite_Battler
alias update_position_for_high_enemy update_position
def update_position
update_position_for_high_enemy
if (dec = bitmap.height - 296) > 0 then self.y += dec end
end
end
顺便弄个五行脚本版
class Sprite_Battler # 超高敌人 Y 坐标自适应
alias update_position_for_high_enemy update_position
def update_position; update_position_for_high_enemy
if (dec = bitmap.height - 296) > 0 then self.y += dec end
end;end
class Sprite_Battler # 超高敌人 Y 坐标自适应
alias update_position_for_high_enemy update_position
def update_position; update_position_for_high_enemy
if (dec = bitmap.height - 296) > 0 then self.y += dec end
end;end
作者: adahs 时间: 2019-12-8 09:26
大佬,我新建了一个工程这个脚本没问题,但是在我自己的工程里面就会报错,应该是脚本冲突了吧,放最上面也不行,有什么办法吗
作者: adahs 时间: 2019-12-8 10:36
不行啊,加了bitmap以后虽然不会报错了,普通大小的敌人可以正常显示,但是超过正常大小的敌人会闪一下就消失掉
作者: KB.Driver 时间: 2019-12-8 12:30
class Sprite_Battler
alias update_position_for_high_enemy update_position
def update_position
update_position_for_high_enemy
if bitmap && (dec = bitmap.height - 296) > 0
self.y += dec if self.y <= Graphics.height - 120
end
end
end
class Sprite_Battler
alias update_position_for_high_enemy update_position
def update_position
update_position_for_high_enemy
if bitmap && (dec = bitmap.height - 296) > 0
self.y += dec if self.y <= Graphics.height - 120
end
end
end
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |