加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
已经用起来了,也能使用。
问题是介绍里说,cmd调用公共事件编号_名字_2 # 此为鼠标经过的图片
应该是说鼠标放上去会显示出来的意思吧。
我加了张后面带_2的图片,并没有那个效果啊
#============================================================================== # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息 #============================================================================== #格式:显示的cmd图片的命名格式为: # cmd调用公共事件编号_名字 # cmd调用公共事件编号_名字_2 # 此为鼠标经过的图片 # #即,带有cmd的为可以点击的图片,点击后执行相应的公共事件..... #不带cmd的图片没任何影响。。。 #============================================================================== class Game_Picture def name=(str) @name = str end end class Sprite_Picture alias update_old update def update update_old begin return if @picture_name[/cmd/].nil? or @picture_name == "" rescue return end mx,my = Mouse.get_mouse_pos lx = self.x - self.ox rx = lx + self.bitmap.width ty = self.y - self.oy by = ty + self.bitmap.height if mx < lx or mx > rx or my < ty or my > by or self.bitmap.get_pixel(mx-lx,my-ty).alpha == 0 @picture.name = @picture.name.split(/_/)[0]+"_"+@picture.name.split(/_/)[1] return end if @picture.name.split(/_/)[2].nil? picname = @picture.name + "_2" $a = 1 #第2张图片不存在的时候不显示 if FileTest.exist?("Graphics/Pictures/#{picname}.png") @picture.name = picname picname2 = @picture.name.split(/_/)[1] + "map" if FileTest.exist?("Graphics/Pictures/#{picname2}.png") $mapname = picname2 end end end #对话框存在的时候不启动事件 if Mouse.trigger?(Mouse::LEFT) and !$game_system.map_interpreter.running? @picture.name.split(/_/)[0].sub(/cmd([0-9]+)/,"") $game_temp.common_event_id = $1.to_i end end end #============================================================================== # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息 #==============================================================================
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
#格式:显示的cmd图片的命名格式为:
# cmd调用公共事件编号_名字
# cmd调用公共事件编号_名字_2 # 此为鼠标经过的图片
#
#即,带有cmd的为可以点击的图片,点击后执行相应的公共事件.....
#不带cmd的图片没任何影响。。。
#==============================================================================
class Game_Picture
def name=(str)
@name = str
end
end
class Sprite_Picture
alias update_old update
def update
update_old
begin
return if @picture_name[/cmd/].nil? or @picture_name == ""
rescue
return
end
mx,my = Mouse.get_mouse_pos
lx = self.x - self.ox
rx = lx + self.bitmap.width
ty = self.y - self.oy
by = ty + self.bitmap.height
if mx < lx or mx > rx or my < ty or my > by or
self.bitmap.get_pixel(mx-lx,my-ty).alpha == 0
@picture.name = @picture.name.split(/_/)[0]+"_"+@picture.name.split(/_/)[1]
return
end
if @picture.name.split(/_/)[2].nil?
picname = @picture.name + "_2"
$a = 1
#第2张图片不存在的时候不显示
if FileTest.exist?("Graphics/Pictures/#{picname}.png")
@picture.name = picname
picname2 = @picture.name.split(/_/)[1] + "map"
if FileTest.exist?("Graphics/Pictures/#{picname2}.png")
$mapname = picname2
end
end
end
#对话框存在的时候不启动事件
if Mouse.trigger?(Mouse::LEFT) and !$game_system.map_interpreter.running?
@picture.name.split(/_/)[0].sub(/cmd([0-9]+)/,"")
$game_temp.common_event_id = $1.to_i
end
end
end
#==============================================================================
# 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
#==============================================================================
|