Project1

标题: 应求发布:反色 [打印本页]

作者: zh99998    时间: 2009-6-10 15:20
标题: 应求发布:反色
  1. module AntiColor
  2.   module_function
  3.   def start
  4.     return if @active
  5.     @foreground = Sprite.new
  6.     @foreground.z = 501
  7.     @foreground.blend_type = 2
  8.     @foreground.bitmap = Graphics.snap_to_bitmap
  9.     @background = Sprite.new
  10.     @background.z = 500
  11.     @background.bitmap = Bitmap.new(Graphics.width, Graphics.height)
  12.     @background.bitmap.fill_rect(0, 0, Graphics.width, Graphics.height,Color.new(255,255,255))
  13.     @active = true
  14.   end
  15.   def update
  16.     return unless @active
  17.     @background.visible = false
  18.     @foreground.visible = false
  19.     @foreground.bitmap.dispose
  20.     @foreground.bitmap = Graphics.snap_to_bitmap
  21.     @background.visible = true
  22.     @foreground.visible = true
  23.   end
  24.   def terminate
  25.     return unless @active
  26.     @foreground.dispose
  27.     @background.dispose
  28.     @active = false
  29.     GC.start
  30.   end
  31. end
  32. class <<Graphics
  33.   alias update_zh99998_anticolor update
  34.   def update
  35.     AntiColor.update
  36.     update_zh99998_anticolor
  37.   end
  38. end

复制代码

范例:http://rpg.blue/upload_program/d/zh99998_Project87_125056344.rar


在这晒两天然后转发布区……
作者: 雪流星    时间: 2009-6-10 17:36
好像N久以前我就写了一个....
不过是静止的


Anticolor.start调用第二字就会死机
最好作个限制


作者: zh99998    时间: 2009-6-10 17:40
谢,已经修正
作者: 雪流星    时间: 2009-6-10 17:42
BUG回报
start调用一阵之後会掉祯
terminate之後不会完全恢复

按F12回Scene_Title会出错
作者: zh99998    时间: 2009-6-10 17:51
F12错误我到现在都不太清楚是什么原因……不过这么短的脚本都出错的话大概就是在alias了……嗯……那玩意怎么修复

吃内存的问题解决了
作者: hitlerson    时间: 2009-6-10 22:08
重定义的函数名号变态,吐了 吐了!
作者: zh99998    时间: 2009-6-10 22:13
咋了……我一直是这么定义的啊

原函数名_zh99998_脚本名
作者: tommay    时间: 2009-6-10 23:28
既然考虑这些问题了,请教下:“去色”的算法,谢谢!
作者: zh99998    时间: 2009-6-10 23:39
什么叫【去色】
作者: tommay    时间: 2009-6-10 23:56
应该是变成黑白的图吧,具体参考PS菜单中的图像——>调整——>去色
作者: 八云紫    时间: 2009-6-11 01:23
精灵颜色合成么??
作者: hide秀    时间: 2009-6-11 01:53
alias update_zh99998_anticolor update unless method_defined? :update
这样试试看 {/wx}
作者: zh99998    时间: 2009-6-11 03:52
这不就是所谓的去色吗

作者: tommay    时间: 2009-6-11 04:55
多谢zh{/wx}
作者: 紫苏    时间: 2009-6-11 07:06
F12 的问题用秀秀的方法,或者把整段脚本用这个包围起来都行:

unless $XXXXX

# ....
# 脚本
# ....

$XXXXX = 1; end
作者: 越前リョーマ    时间: 2009-6-11 07:41
去色?
对黑白线稿用过一次……然后白底就变透明了。(好吧,这是sai里用的…… - -)




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