本帖最后由 JasperCrazy 于 2021-8-13 18:36 编辑
最终效果:
基于大佬的脚本,改了一个运算更快的,如果只需用到静态画面的话,可以用这个:
class Bitmap def inverse! self.process_color do |a| a.size.times do |i| a[i].red = 255-a[i].red a[i].green = 255-a[i].green a[i].blue = 255-a[i].blue end end end def inverse b = self.clone b.inverse! return b end end class Scene_Battle def inverse_color @s = Sprite.new @s.bitmap = Graphics.snap_to_bitmap @s.bitmap = @s.bitmap.inverse end end class Scene_Battle def recover_color @s.bitmap.dispose end end # 调用方法-开启反色:SceneManager.scene.inverse_color # 调用方法-关闭反色:SceneManager.scene.recover_color
class Bitmap
def inverse!
self.process_color do |a|
a.size.times do |i|
a[i].red = 255-a[i].red
a[i].green = 255-a[i].green
a[i].blue = 255-a[i].blue
end
end
end
def inverse
b = self.clone
b.inverse!
return b
end
end
class Scene_Battle
def inverse_color
@s = Sprite.new
@s.bitmap = Graphics.snap_to_bitmap
@s.bitmap = @s.bitmap.inverse
end
end
class Scene_Battle
def recover_color
@s.bitmap.dispose
end
end
# 调用方法-开启反色:SceneManager.scene.inverse_color
# 调用方法-关闭反色:SceneManager.scene.recover_color
|