end
def self.into_menu
Sound.play_ok
SceneManager.call(Scene_Menu)
Window_MenuCommand::init_command_position
end
def self.init2
#Directions
@dir = 0
@old_x, @old_y = 0, 0
#Animations
@light_id = 1
@mouse_sprite1 = Sprite.new;
@mouse_sprite1.z = 9999;
@mouse_sprite1.bitmap = Bitmap.new("Graphics/Icons/#{@light_id}");
@light_id = 1
@canyin = []
@rmenu = nil#右键菜单
@rightmenu = false
@mouse_touch = false
@count = 0
@npc,@wait,@coach = false
end
def self.setbb(a,b,c,d,e,f,g,h,i)
@blend_tepe = a if a != nil
@opacity = b if b != nil
@jy = c if c != nil
@zoom_x = d if d != nil
@zoom_y = e if e != nil
@light = f if f != nil
@shadow = g if g != nil
@angle = h if h != nil
@anima = i if i != nil
end
def self.show_light(mx, my)
@canyin.each{|s|s.opacity <= 0 ? (s.visible = false ; @canyin.delete(s)) : s.opacity -= 25}
if @light
@light_id < 94 ? @light_id += 1 : @light_id = 1
i = @light_id
eval("@mouse_sprite#{i} = Sprite.new")
eval("@mouse_sprite#{i}.x = #{mx}")
eval("@mouse_sprite#{i}").y = my
eval("@mouse_sprite#{i}").blend_type = @blend_tepe
eval("@mouse_sprite#{i}").z = 9999;
#eval("@mouse_sprite#{i}").angle = @mouse_sprite.angle
eval("@mouse_sprite#{i}").bitmap = Bitmap.new("Graphics/Icons/#{@light_id}")
for i in 1..94
begin
eval("@mouse_sprite#{i}").opacity -= @opacity #10
eval("@mouse_sprite#{i}").y += @jy#1
eval("@mouse_sprite#{i}").zoom_x += @zoom_x#0.105
eval("@mouse_sprite#{i}").zoom_y += @zoom_y#0.105
eval("@mouse_sprite#{i}").dispose if eval("@mouse_sprite#{i}").opacity <= 0
rescue
end
end
if @plight == true
self.update_light
end
end
return if !@angle
a = 0
#被废掉的朝向
hu = [(@old_x - mx), (@old_y - my)]
return if hu[0] == 0 or hu[1] == 0
math = 135 - self.atoa(Math.atan(hu[1]/hu[0]))
if hu[0] > 0
@mouse_sprite.angle = math - 90
else
@mouse_sprite.angle = math + 90
end
#p math
@old_x, @old_y = mx, my
# }
@rmenu.x,@rmenu.y = x,y
@rmenu.opacity = 200
@rightmenu = true
end
def self.mouse_touch=(bar)
@mouse_touch = bar
end
def self.mouse_touch
return @mouse_touch
end
def self.check
if Mouse.trigger?(Mouse::LEFT)
if @rightmenu
mx,my = Mouse.get_mouse_pos
lx = @rmenu.x - @rmenu.ox
rx = lx + @rmenu.bitmap.width
ty = @rmenu.y - @rmenu.oy
by = ty + @rmenu.bitmap.height
if mx < lx or mx > rx or my < ty or my > by or
@rmenu.bitmap.get_pixel(mx-lx,my-ty).alpha == 0
else
a = []
text.size.times{|t|a << [t*32 , ([email protected]).abs].min}
eval(text[(a.max/32).to_i][1])
end
@rightmenu = false
@rmenu.dispose
@rmenu = nil
return
end
end
end
end
Mouse.init2
Mouse.setbb(合成方式,
透明速度,
下降速度,
X放大率,
Y放大率,残光,残影,旋转,动态)作者: huyangvista 时间: 2013-5-31 00:05
鼠标在地图 点击右键然后再点击左键 就崩溃了
提示 nomethodError undefined merhod width for nil nilclass 错误作者: 魔力的觉醒 时间: 2013-5-31 00:06
换个鼠标系统呗!!作者: Yophs 时间: 2013-6-2 15:56 本帖最后由 Yophs 于 2013-6-2 16:17 编辑