Project1
标题:
鼠标响应图片时怎么出现声音呢?
[打印本页]
作者:
芥菜种的天空
时间:
2013-8-22 18:35
标题:
鼠标响应图片时怎么出现声音呢?
我用了鼠标响应图片的脚本,但是出不来碰到图片后被选中的声音,请求大家帮帮忙啊,小的在这先谢谢大家啊~~
作者:
紫英晓狼1130
时间:
2013-8-23 05:13
这是我做的天龙八部标题范例里的原脚本,24行有改动
class Game_Picture
def name=(str)
@name = str
end
end
class Sprite_Picture
alias update_old update
def update
update_old
return if @picture_name == "" or @picture_name[/cmd/].nil?
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]+"_"
[email protected]
(/_/)[1]
return
end
if @picture.name.split(/_/)[2].nil?
@picture.name = @picture.name + "_02"
Audio.se_play("Audio/SE/"+"se.ogg",90,100)
end
if Input.trigger?(13)
@picture.name.split(/_/)[0].sub(/cmd([0-9]+)/,"")
$game_temp.common_event_id = $1.to_i
end
end
end
复制代码
作者:
芥菜种的天空
时间:
2013-8-23 09:08
嘻嘻,谢谢你啊,之前加过那个代码但是加错地方了,现在可以了呢!万分感谢
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1