加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 end55rpg 于 2013-8-16 18:22 编辑
这个不是。。。
拓展了一下- -流动光条。。效果不错,(喂!不要看fps
代码待发- -
召唤bbb= =:
@弗雷德 @satgo1546 @@kfflX @你最珍贵 @烟倦 @神秘影子 等等
################################################ =begin 使用说明:此脚本运用中心处放大法实现描边。 使用方法:更改父类继承需要描边的精灵 更改super(args)参数、更改(父类图像的)path以及obj_name。 基本完成,其他代码自行修改微调即可。 本脚本示范人物行走图的描边,其他描边的注意ox,oy也要实现到中央(这里通过改y坐标) zoom可自行更改,blur(模糊)源码自带,VX不需要 =end ################################################ class Sprite_MB < Sprite_Character#←RPG::Sprite def initialize(viewport,obj)#初始化对像 super(viewport,obj) obj_name=@character.character_name# ablack("Graphics/Characters/",obj_name) update end def update#更新画面 super;zoom=1.1 self.zoom_x,self.zoom_y = zoom,zoom self.z += -1 self.y += @ch*(self.zoom_y-1)/2 self.blend_type,self.opacity = 1,100 end def ablack(path,obj_name)#描边 self.bitmap = Bitmap.new(path+obj_name) self.color.set(255,255,255,255) self.bitmap.blur() rescue false end end
################################################
=begin
使用说明:此脚本运用中心处放大法实现描边。
使用方法:更改父类继承需要描边的精灵
更改super(args)参数、更改(父类图像的)path以及obj_name。
基本完成,其他代码自行修改微调即可。
本脚本示范人物行走图的描边,其他描边的注意ox,oy也要实现到中央(这里通过改y坐标)
zoom可自行更改,blur(模糊)源码自带,VX不需要
=end
################################################
class Sprite_MB < Sprite_Character#←RPG::Sprite
def initialize(viewport,obj)#初始化对像
super(viewport,obj)
obj_name=@character.character_name#
ablack("Graphics/Characters/",obj_name)
update
end
def update#更新画面
super;zoom=1.1
self.zoom_x,self.zoom_y = zoom,zoom
self.z += -1
self.y += @ch*(self.zoom_y-1)/2
self.blend_type,self.opacity = 1,100
end
def ablack(path,obj_name)#描边
self.bitmap = Bitmap.new(path+obj_name)
self.color.set(255,255,255,255)
self.bitmap.blur() rescue false
end
end
一共20行
示范的事件描边添加下面这句:
class Spriteset_Map alias ini initialize def initialize ini for i in $game_map.events.keys.sort @character_sprites.push Sprite_MB.new(@viewport1, $game_map.events[i]) end end end
class Spriteset_Map
alias ini initialize
def initialize
ini
for i in $game_map.events.keys.sort
@character_sprites.push Sprite_MB.new(@viewport1, $game_map.events[i])
end
end
end
(引用)需要的模糊blur方法;
class Bitmap def blur(times=1,during =1,blur=1) #blur(重做模糊次数,经历帧数,分散半径) for i in 1..times blur_r(blur) for j in 1..during Graphics.update if i > 1 and during >1 end end end def blur_r(radius = 2)#blur_r(分散半径) radius = 1 if radius <= 1 or radius == nil #值的修正 src_bitmap = self rect = self.rect ta_l = 1+radius*2 ta = Table.new(ta_l,ta_l) #过滤器 for i in 0..ta_l-1 for j in 0..ta_l-1 ta[i,j] = 1 end end ta[((ta.xsize+1)/2)-1,((ta.xsize+1)/2)-1] = 2**(1+radius) main = ta[((ta.xsize+1)/2)-1,((ta.xsize+1)/2)-1]#找到中心点 nn = 2;j = ((ta.xsize+1)/2)-1;line =[]#主干道 for i in 0..((ta.xsize+1)/2)-2 ta[i,j] = nn ta[j,i] = nn ta[ta.xsize-1-i,j] = nn ta[j,ta.xsize-1-i] = nn line.push ta[i,((ta.xsize+1)/2)-1] nn = nn * 2 end for j in 0..line.size-1 for i in 0..((ta.xsize+1)/2)-2 line[j] = line[j]/2 if line[j] == 1 break else ta[((ta.xsize+1)/2)-2-i,j] = line[j] ta[((ta.xsize+1)/2)+i,j] = line[j] ta[((ta.xsize+1)/2)-2-i,ta.xsize-1-j] = line[j] ta[((ta.xsize+1)/2)+i,ta.xsize-1-j] = line[j] end end end key_a = [];key_p = main for i in 1..main if key_p == 1 key_a.push main break else key_p = key_p/2 key_a.push key_p end end key_k = 0 for i in 0..key_a.size-1 key_k = key_k + key_a[i] end key = 255/key_k key = 1 if key <= 0 #值的修正 for i in 0..ta.xsize-1 for j in 0..ta.ysize-1 key_main = key*ta[i,j] key_main = 255 if key_main > 255 ; key_main = 1 if key_main < 0 #值的修正 self.blt(i-(((ta.xsize+1)/2)-1),j-(((ta.xsize+1)/2)-1),src_bitmap,rect,key_main) end end end end
class Bitmap
def blur(times=1,during =1,blur=1)
#blur(重做模糊次数,经历帧数,分散半径)
for i in 1..times
blur_r(blur)
for j in 1..during
Graphics.update if i > 1 and during >1
end
end
end
def blur_r(radius = 2)#blur_r(分散半径)
radius = 1 if radius <= 1 or radius == nil #值的修正
src_bitmap = self
rect = self.rect
ta_l = 1+radius*2
ta = Table.new(ta_l,ta_l) #过滤器
for i in 0..ta_l-1
for j in 0..ta_l-1
ta[i,j] = 1
end
end
ta[((ta.xsize+1)/2)-1,((ta.xsize+1)/2)-1] = 2**(1+radius)
main = ta[((ta.xsize+1)/2)-1,((ta.xsize+1)/2)-1]#找到中心点
nn = 2;j = ((ta.xsize+1)/2)-1;line =[]#主干道
for i in 0..((ta.xsize+1)/2)-2
ta[i,j] = nn
ta[j,i] = nn
ta[ta.xsize-1-i,j] = nn
ta[j,ta.xsize-1-i] = nn
line.push ta[i,((ta.xsize+1)/2)-1]
nn = nn * 2
end
for j in 0..line.size-1
for i in 0..((ta.xsize+1)/2)-2
line[j] = line[j]/2
if line[j] == 1
break
else
ta[((ta.xsize+1)/2)-2-i,j] = line[j]
ta[((ta.xsize+1)/2)+i,j] = line[j]
ta[((ta.xsize+1)/2)-2-i,ta.xsize-1-j] = line[j]
ta[((ta.xsize+1)/2)+i,ta.xsize-1-j] = line[j]
end
end
end
key_a = [];key_p = main
for i in 1..main
if key_p == 1
key_a.push main
break
else
key_p = key_p/2
key_a.push key_p
end
end
key_k = 0
for i in 0..key_a.size-1
key_k = key_k + key_a[i]
end
key = 255/key_k
key = 1 if key <= 0 #值的修正
for i in 0..ta.xsize-1
for j in 0..ta.ysize-1
key_main = key*ta[i,j]
key_main = 255 if key_main > 255 ; key_main = 1 if key_main < 0 #值的修正
self.blt(i-(((ta.xsize+1)/2)-1),j-(((ta.xsize+1)/2)-1),src_bitmap,rect,key_main)
end
end
end
end
传送门:
最近统一发的脚本、范例一览:
1.WebRgssM简称END6r`s webrm
2.研究奇特画面效果
3.赶选中抽取的:我是大红点
4.赶选中抽取的:画面的缩放(荐)
5.待开发。。。
6.忘记了- -
7
....
99.木有啦!
|