Project1

标题: 求让这个图片标题脚本能配合鼠标脚本 [打印本页]

作者: 秋寒    时间: 2013-5-10 11:55
标题: 求让这个图片标题脚本能配合鼠标脚本
本帖最后由 1426 于 2013-5-11 11:42 编辑

谁能帮忙把这个脚本改成配合鼠标脚本使用
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4.  
  5. #==============================================================================
  6. # ■ 图片标题菜单1.0
  7. # Scene_Title
  8. #------------------------------------------------------------------------------
  9. # 作者:chaochao
  10. # [url]http://zhuchao.go1.icpcn.com[/url]
  11. #==============================================================================
  12. class Scene_Title
  13.   def main
  14.     if $BTEST
  15.       battle_test
  16.       return
  17.     end
  18.     $data_actors = load_data("Data/Actors.rxdata")
  19.     $data_classes = load_data("Data/Classes.rxdata")
  20.     $data_skills = load_data("Data/Skills.rxdata")
  21.     $data_items = load_data("Data/Items.rxdata")
  22.     $data_weapons = load_data("Data/Weapons.rxdata")
  23.     $data_armors = load_data("Data/Armors.rxdata")
  24.     $data_enemies = load_data("Data/Enemies.rxdata")
  25.     $data_troops = load_data("Data/Troops.rxdata")
  26.     $data_states = load_data("Data/States.rxdata")
  27.     $data_animations = load_data("Data/Animations.rxdata")
  28.     $data_tilesets = load_data("Data/Tilesets.rxdata")
  29.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  30.     $data_system = load_data("Data/System.rxdata")
  31.     $game_system = Game_System.new
  32.     # 生成标题图形
  33.     [url=home.php?mod=space&uid=114926]@sprite[/url] = [Sprite.new]
  34.     for i in 0..6
  35.       @sprite[i] = Sprite.new
  36.       @sprite[i].opacity = 0
  37.     end
  38.     @sprite[0].bitmap = RPG::Cache.title($data_system.title_name)
  39.     @sprite[0].opacity = 0
  40.     #开始游戏的图片
  41.     @sprite[1].bitmap = Bitmap.new("Graphics/Pictures/start_1.png")
  42.     @sprite[2].bitmap = Bitmap.new("Graphics/Pictures/start_2.png")
  43.     #继续游戏的图片
  44.     @sprite[3].bitmap = Bitmap.new("Graphics/Pictures/continue_1.png")
  45.     @sprite[4].bitmap = Bitmap.new("Graphics/Pictures/continue_2.png")
  46.     #结束游戏的图片
  47.     @sprite[5].bitmap = Bitmap.new("Graphics/Pictures/exit_1.png")
  48.     @sprite[6].bitmap = Bitmap.new("Graphics/Pictures/exit_2.png")
  49.     #图片位置
  50.     for i in 1..6
  51.       x=110
  52.       y=(i+1)/2*35+240
  53.       @sprite[i].x =x
  54.       @sprite[i].y =y
  55.     end
  56.     @continue_enabled = false
  57.     for i in 0..3
  58.       if FileTest.exist?("Save/Save#{i+1}.rxdata")
  59.         @continue_enabled = true
  60.       end
  61.     end
  62.     if @continue_enabled
  63.       @command_index = 1
  64.     else
  65.       @command_index = 0
  66.       @sprite[3].tone = Tone.new(0, 0, 0, 255)
  67.       @sprite[4].tone = Tone.new(0, 0, 0, 255)
  68.     end
  69.     $game_system.bgm_play($data_system.title_bgm)
  70.     Audio.me_stop
  71.     Audio.bgs_stop
  72.     Graphics.transition
  73.     loop do
  74.       Graphics.update
  75.       #淡出背景圖形
  76.       if @sprite[0].opacity <= 255
  77.         @sprite[0].opacity += 15
  78.       end
  79.       Input.update
  80.       update
  81.       if $scene != self
  82.         break
  83.       end
  84.     end
  85.     Graphics.freeze
  86.     # 釋放圖形
  87.     for i in 0..6
  88.       @sprite[i].bitmap.dispose
  89.       @sprite[i].dispose
  90.     end
  91.   end
  92.   def update
  93.   chaochaocommandchaochao
  94.   if Input.trigger?(Input::C)
  95.     case @command_index
  96.       when 0
  97.         command_new_game
  98.       when 1
  99.         command_continue
  100.       when 2
  101.         command_shutdown
  102.       end
  103.     end
  104.   end
  105.   def chaochaocommandchaochao
  106.     if Input.trigger?(Input::UP)
  107.       @command_index -= 1
  108.       if @command_index < 0
  109.         @command_index = 2
  110.       end
  111.       $game_system.se_play($data_system.cursor_se)
  112.     end
  113.     if Input.trigger?(Input::DOWN)
  114.       @command_index += 1
  115.       if @command_index > 2
  116.         @command_index = 0
  117.       end
  118.       $game_system.se_play($data_system.cursor_se)
  119.     end
  120.     case @command_index
  121.     when 0
  122.       if @sprite[1].opacity >= 0
  123.         @sprite[1].opacity -= 30
  124.       end
  125.       if @sprite[2].opacity <= 240
  126.         @sprite[2].opacity += 30
  127.       end
  128.       if @sprite[3].opacity <= 210
  129.         @sprite[3].opacity += 30
  130.       end
  131.       if @sprite[4].opacity >= 0
  132.         @sprite[4].opacity -= 30
  133.       end
  134.       if @sprite[5].opacity <= 210
  135.         @sprite[5].opacity += 30
  136.       end
  137.       if @sprite[6].opacity >= 0
  138.         @sprite[6].opacity -= 30
  139.       end
  140.     when 1
  141.       if @sprite[1].opacity <= 210
  142.         @sprite[1].opacity += 30
  143.       end
  144.       if @sprite[2].opacity >= 0
  145.         @sprite[2].opacity -= 30
  146.       end
  147.       if @sprite[3].opacity >= 0
  148.         @sprite[3].opacity -= 30
  149.       end
  150.       if @sprite[4].opacity <= 240
  151.         @sprite[4].opacity += 30
  152.       end
  153.       if @sprite[5].opacity <= 210
  154.         @sprite[5].opacity += 30
  155.       end
  156.       if @sprite[6].opacity >= 0
  157.         @sprite[6].opacity -= 30
  158.       end
  159.     when 2
  160.       if @sprite[1].opacity <= 210
  161.         @sprite[1].opacity += 30
  162.       end
  163.       if @sprite[2].opacity >= 0
  164.         @sprite[2].opacity -= 30
  165.       end
  166.       if @sprite[3].opacity <= 210
  167.         @sprite[3].opacity += 30
  168.       end
  169.       if @sprite[4].opacity >= 0
  170.         @sprite[4].opacity -= 30
  171.       end
  172.       if @sprite[5].opacity >= 0
  173.         @sprite[5].opacity -= 30
  174.       end
  175.       if @sprite[6].opacity <= 240
  176.         @sprite[6].opacity += 30
  177.       end
  178.     end
  179.   end
  180. end
  181. #==============================================================================
  182. # ■ 图片标题菜单1.0
  183. # Scene_Title
  184. #------------------------------------------------------------------------------
  185. # 作者:chaochao
  186. # [url]http://zhuchao.go1.icpcn.com[/url]
  187. #==============================================================================
  188. class Scene_Title
  189.   def main
  190.     if $BTEST
  191.       battle_test
  192.       return
  193.     end
  194.     $data_actors = load_data("Data/Actors.rxdata")
  195.     $data_classes = load_data("Data/Classes.rxdata")
  196.     $data_skills = load_data("Data/Skills.rxdata")
  197.     $data_items = load_data("Data/Items.rxdata")
  198.     $data_weapons = load_data("Data/Weapons.rxdata")
  199.     $data_armors = load_data("Data/Armors.rxdata")
  200.     $data_enemies = load_data("Data/Enemies.rxdata")
  201.     $data_troops = load_data("Data/Troops.rxdata")
  202.     $data_states = load_data("Data/States.rxdata")
  203.     $data_animations = load_data("Data/Animations.rxdata")
  204.     $data_tilesets = load_data("Data/Tilesets.rxdata")
  205.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  206.     $data_system = load_data("Data/System.rxdata")
  207.     $game_system = Game_System.new
  208.     # 生成标题图形
  209.     @sprite = [Sprite.new]
  210.     for i in 0..6
  211.       @sprite[i] = Sprite.new
  212.       @sprite[i].opacity = 0
  213.     end
  214.     @sprite[0].bitmap = RPG::Cache.title($data_system.title_name)
  215.     @sprite[0].opacity = 0
  216.     #开始游戏的图片
  217.     @sprite[1].bitmap = Bitmap.new("Graphics/Pictures/start_1.png")
  218.     @sprite[2].bitmap = Bitmap.new("Graphics/Pictures/start_2.png")
  219.     #继续游戏的图片
  220.     @sprite[3].bitmap = Bitmap.new("Graphics/Pictures/continue_1.png")
  221.     @sprite[4].bitmap = Bitmap.new("Graphics/Pictures/continue_2.png")
  222.     #结束游戏的图片
  223.     @sprite[5].bitmap = Bitmap.new("Graphics/Pictures/exit_1.png")
  224.     @sprite[6].bitmap = Bitmap.new("Graphics/Pictures/exit_2.png")
  225.     #图片位置
  226.     for i in 1..6
  227.       x=220
  228.       y=(i+1)/2*35+240
  229.       @sprite[i].x =x
  230.       @sprite[i].y =y
  231.     end
  232.     @continue_enabled = false
  233.     for i in 0..3
  234.       if FileTest.exist?("Save/Save#{i+1}.rxdata")
  235.         @continue_enabled = true
  236.       end
  237.     end
  238.     if @continue_enabled
  239.       @command_index = 1
  240.     else
  241.       @command_index = 0
  242.       @sprite[3].tone = Tone.new(0, 0, 0, 255)
  243.       @sprite[4].tone = Tone.new(0, 0, 0, 255)
  244.     end
  245.     $game_system.bgm_play($data_system.title_bgm)
  246.     Audio.me_stop
  247.     Audio.bgs_stop
  248.     Graphics.transition
  249.     loop do
  250.       Graphics.update
  251.       #淡出背景圖形
  252.       if @sprite[0].opacity <= 255
  253.         @sprite[0].opacity += 15
  254.       end
  255.       Input.update
  256.       update
  257.       if $scene != self
  258.         break
  259.       end
  260.     end
  261.     Graphics.freeze
  262.     # 釋放圖形
  263.     for i in 0..6
  264.       @sprite[i].bitmap.dispose
  265.       @sprite[i].dispose
  266.     end
  267.   end
  268.   def update
  269.   chaochaocommandchaochao
  270.   if Input.trigger?(Input::C)
  271.     case @command_index
  272.       when 0
  273.         command_new_game
  274.       when 1
  275.         command_continue
  276.       when 2
  277.         command_shutdown
  278.       end
  279.     end
  280.   end
  281.   def chaochaocommandchaochao
  282.     if Input.trigger?(Input::UP)
  283.       @command_index -= 1
  284.       if @command_index < 0
  285.         @command_index = 2
  286.       end
  287.       $game_system.se_play($data_system.cursor_se)
  288.     end
  289.     if Input.trigger?(Input::DOWN)
  290.       @command_index += 1
  291.       if @command_index > 2
  292.         @command_index = 0
  293.       end
  294.       $game_system.se_play($data_system.cursor_se)
  295.     end
  296.     case @command_index
  297.     when 0
  298.       if @sprite[1].opacity >= 0
  299.         @sprite[1].opacity -= 30
  300.       end
  301.       if @sprite[2].opacity <= 240
  302.         @sprite[2].opacity += 30
  303.       end
  304.       if @sprite[3].opacity <= 210
  305.         @sprite[3].opacity += 30
  306.       end
  307.       if @sprite[4].opacity >= 0
  308.         @sprite[4].opacity -= 30
  309.       end
  310.       if @sprite[5].opacity <= 210
  311.         @sprite[5].opacity += 30
  312.       end
  313.       if @sprite[6].opacity >= 0
  314.         @sprite[6].opacity -= 30
  315.       end
  316.     when 1
  317.       if @sprite[1].opacity <= 210
  318.         @sprite[1].opacity += 30
  319.       end
  320.       if @sprite[2].opacity >= 0
  321.         @sprite[2].opacity -= 30
  322.       end
  323.       if @sprite[3].opacity >= 0
  324.         @sprite[3].opacity -= 30
  325.       end
  326.       if @sprite[4].opacity <= 240
  327.         @sprite[4].opacity += 30
  328.       end
  329.       if @sprite[5].opacity <= 210
  330.         @sprite[5].opacity += 30
  331.       end
  332.       if @sprite[6].opacity >= 0
  333.         @sprite[6].opacity -= 30
  334.       end
  335.     when 2
  336.       if @sprite[1].opacity <= 210
  337.         @sprite[1].opacity += 30
  338.       end
  339.       if @sprite[2].opacity >= 0
  340.         @sprite[2].opacity -= 30
  341.       end
  342.       if @sprite[3].opacity <= 210
  343.         @sprite[3].opacity += 30
  344.       end
  345.       if @sprite[4].opacity >= 0
  346.         @sprite[4].opacity -= 30
  347.       end
  348.       if @sprite[5].opacity >= 0
  349.         @sprite[5].opacity -= 30
  350.       end
  351.       if @sprite[6].opacity <= 240
  352.         @sprite[6].opacity += 30
  353.       end
  354.     end
  355.   end
  356. end
  357.  
  358. #==============================================================================
  359. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  360. #==============================================================================

以上是图片标题脚本,以下是鼠标脚本
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4.  
  5. #=================以下两个用来调整战斗时的手感问题,可以自己试试。
  6. $敌人选框扩大 = 2
  7. $角色选框扩大 = 2
  8. $钓鱼系统 = 2
  9.  
  10. #==============================================================================
  11. # API调用
  12. #==============================================================================
  13. $ShowCursor = Win32API.new("user32", "ShowCursor", 'i', 'l')
  14. $GetCursorPos = Win32API.new("user32", "GetCursorPos", 'p', 'i')
  15. $ScreenToClient = Win32API.new("user32", "ScreenToClient", 'ip', 'i')
  16. $GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l')
  17. $Window_HWND = $GetActiveWindow.call
  18. $GetKeyState = Win32API.new("user32", "GetKeyState", 'i', 'i')
  19. #$FindWindow = Win32API.new("user32", "FindWindow", 'pp', 'i')
  20. #$HookStart  = Win32API.new("mouse_hook.dll", "HookStart", 'i', nil)
  21. #$HookEnd  = Win32API.new("mouse_hook.dll", "HookEnd", nil, nil)
  22. #$GetMouseStatus  = Win32API.new("mouse_hook.dll", "GetMouseStatus", 'i', 'i')
  23. #$Window_HWND = $FindWindow.call(nil, 'mousetry')
  24.  
  25. module Mouse  
  26.   LEFT = 0x01
  27.   RIGHT = 0x02
  28.  
  29.   def self.init(sprite = nil)
  30. #   $HookStart.call($Window_HWND)
  31.     $ShowCursor.call(0)
  32.  
  33.     @show_cursor = false
  34.  
  35.     @mouse_sprite = Sprite.new
  36.     @mouse_sprite.z = 99999
  37.     $mouseshow = false
  38.     @mouse_sprite.bitmap = Bitmap.new('Graphics/Icons/001-Weapon01')
  39.     #@mouse_sprite.bitmap.fill_rect(Rect.new(0, 0, 32, 32), Color.new(0, 0, 0))
  40.     @left_press = false
  41.     @right_press = false
  42.     @left_trigger = false
  43.     @right_trigger = false
  44.     @left_repeat = false
  45.     @right_repeat = false
  46.     @click_lock = false
  47.  
  48.     update
  49.   end
  50.   def self.exit
  51.     @mouse_sprite.bitmap.dispose
  52.     @mouse_sprite.dispose
  53.     @show_cursor = true
  54. #    $HookEnd.call
  55.     $ShowCursor.call(1)
  56.   end
  57.   def self.mouse_debug
  58.     return @mouse_debug.bitmap
  59.   end
  60.   def self.update
  61.     left_down = $GetKeyState.call(0x01)
  62.     right_down = $GetKeyState.call(0x02)
  63.     if $mouseshow == 1
  64.     @mouse_sprite.bitmap = Bitmap.new('Graphics/Icons/001-Weapon01')
  65.     else
  66.     @mouse_sprite.bitmap = Bitmap.new('Graphics/Icons/001-Weapon01')
  67.     end
  68.     @click_lock = false
  69.     mouse_x, mouse_y = self.get_mouse_pos
  70.     if @mouse_sprite != nil
  71.       @mouse_sprite.x = mouse_x
  72.       @mouse_sprite.y = mouse_y
  73.     end
  74.     if left_down[7] == 1
  75.       @left_repeat = (not @left_repeat)
  76.       @left_trigger = (not @left_press)
  77.       @left_press = true
  78.     else
  79.       @left_press = false
  80.       @left_trigger = false
  81.       @left_repeat = false
  82.     end
  83.     if right_down[7] == 1
  84.       @right_repeat = (not @right_repeat)
  85.       @right_trigger = (not @right_press)
  86.       @right_press = true
  87.     else
  88.       @right_press = false
  89.       @right_trigger = false
  90.       @right_repeat = false
  91.     end
  92.   end
  93.   def self.get_mouse_pos
  94.     point_var = [0, 0].pack('ll')
  95.     if $GetCursorPos.call(point_var) != 0
  96.       if $ScreenToClient.call($Window_HWND, point_var) != 0
  97.         x, y = point_var.unpack('ll')
  98.         if (x < 0) or (x > 10000) then x = 0 end
  99.         if (y < 0) or (y > 10000) then y = 0 end
  100.         if x > 640 then x = 640 end
  101.         if y > 480 then y = 480 end
  102.         return x, y
  103.       else
  104.         return 0, 0
  105.       end
  106.     else
  107.       return 0, 0
  108.     end
  109.   end
  110.   def self.press?(mouse_code)
  111.     if mouse_code == LEFT
  112.       if @click_lock
  113.         return false
  114.       else
  115.         return @left_press
  116.       end
  117.     elsif mouse_code == RIGHT
  118.       return @right_press
  119.     else
  120.       return false
  121.     end
  122.   end
  123.   def self.trigger?(mouse_code)
  124.     if mouse_code == LEFT
  125.       if @click_lock
  126.         return false
  127.       else
  128.         return @left_trigger
  129.       end
  130.     elsif mouse_code == RIGHT
  131.       return @right_trigger
  132.     else
  133.       return false
  134.     end
  135.   end
  136.   def self.repeat?(mouse_code)
  137.     if mouse_code == LEFT
  138.       if @click_lock
  139.         return false
  140.       else
  141.         return @left_repeat
  142.       end
  143.     elsif mouse_code == RIGHT
  144.       return @right_repeat
  145.     else
  146.       return false
  147.     end
  148.   end
  149.   def self.click_lock?
  150.     return @click_lock
  151.   end
  152.   def self.click_lock
  153.     @click_lock = true
  154.   end
  155.   def self.click_unlock
  156.     @click_lock = false
  157.   end
  158. end
  159. module Input
  160.   if @self_update == nil
  161.     @self_update = method('update')
  162.     @self_press = method('press?')
  163.     @self_trigger = method('trigger?')
  164.     @self_repeat = method('repeat?')
  165.   end
  166.   def self.update
  167.     @self_update.call
  168.     Mouse.update
  169.   end
  170.   def self.press?(key_code)
  171.     if @self_press.call(key_code)
  172.       return true
  173.     end
  174.     if key_code == C
  175.       return Mouse.press?(Mouse::LEFT)
  176.     elsif key_code == B
  177.       return Mouse.press?(Mouse::RIGHT)
  178.     else
  179.       return @self_press.call(key_code)
  180.     end
  181.   end
  182.   def self.trigger?(key_code)
  183.     if @self_trigger.call(key_code)
  184.       return true
  185.     end
  186.     if key_code == C
  187.       return Mouse.trigger?(Mouse::LEFT)
  188.     elsif key_code == B
  189.       return Mouse.trigger?(Mouse::RIGHT)
  190.     else
  191.       return @self_trigger.call(key_code)
  192.     end
  193.   end
  194.   def self.repeat?(key_code)
  195.     if @self_repeat.call(key_code)
  196.       return true
  197.     end
  198.     if key_code == C
  199.       return Mouse.repeat?(Mouse::LEFT)
  200.     elsif key_code == B
  201.       return Mouse.repeat?(Mouse::RIGHT)
  202.     else
  203.       return @self_repeat.call(key_code)
  204.     end
  205.   end
  206. end
  207. class Window_Selectable
  208.   if @self_alias == nil
  209.     alias self_update update
  210.     @self_alias = true
  211.   end
  212.   def update
  213.     #self.cursor_rect.empty
  214.     self_update
  215.     if self.active and @item_max > 0
  216.       index_var = @index
  217.       tp_index = @index
  218.       mouse_x, mouse_y = Mouse.get_mouse_pos
  219.       mouse_not_in_rect = true
  220.       for i in 0...@item_max
  221.         @index = i
  222.         update_cursor_rect
  223.         top_x = self.cursor_rect.x + self.x + 16
  224.         top_y = self.cursor_rect.y + self.y + 16
  225.         bottom_x = top_x + self.cursor_rect.width
  226.         bottom_y = top_y + self.cursor_rect.height
  227.         if (mouse_x > top_x) and (mouse_y > top_y) and
  228.            (mouse_x < bottom_x) and (mouse_y < bottom_y)
  229.           mouse_not_in_rect = false
  230.           if tp_index != @index
  231.             tp_index = @index
  232.             $game_system.se_play($data_system.cursor_se)
  233.           end
  234.           break
  235.         end
  236.       end
  237.       if mouse_not_in_rect
  238.         @index = index_var
  239.         update_cursor_rect
  240.         Mouse.click_lock
  241.       else
  242.         Mouse.click_unlock               
  243.       end
  244.     end
  245.   end
  246. end
  247. class Window_NameInput
  248.   if @self_alias == nil
  249.     alias self_update update
  250.     @self_alias = true
  251.   end
  252.   def update
  253.     #self.cursor_rect.empty
  254.     self_update
  255.     if self.active
  256.       index_var = @index
  257.       mouse_x, mouse_y = Mouse.get_mouse_pos
  258.       mouse_not_in_rect = true
  259.       for i in (0...CHARACTER_TABLE.size).to_a.push(180)
  260.         @index = i
  261.         update_cursor_rect
  262.         top_x = self.cursor_rect.x + self.x + 16
  263.         top_y = self.cursor_rect.y + self.y + 16
  264.         bottom_x = top_x + self.cursor_rect.width
  265.         bottom_y = top_y + self.cursor_rect.height
  266.         #
  267.         if (mouse_x > top_x) and (mouse_y > top_y) and
  268.            (mouse_x < bottom_x) and (mouse_y < bottom_y)
  269.           mouse_not_in_rect = false
  270.           break
  271.         end
  272.       end
  273.       if mouse_not_in_rect
  274.         @index = index_var
  275.         update_cursor_rect
  276.         Mouse.click_lock
  277.       else
  278.         Mouse.click_unlock
  279.       end
  280.     end
  281.   end
  282. end
  283. class Window_InputNumber
  284.   if @self_alias == nil
  285.     alias self_update update
  286.     @self_alias = true
  287.   end
  288.   def update
  289.     #self.cursor_rect.empty
  290.     self_update
  291.     mouse_x, mouse_y = Mouse.get_mouse_pos
  292.     if self.active and @digits_max > 0
  293.       index_var = @index
  294.       mouse_not_in_rect = true
  295.       for i in 0...@digits_max
  296.         @index = i
  297.         update_cursor_rect
  298.         top_x = self.cursor_rect.x + self.x + 16
  299.         bottom_x = top_x + self.cursor_rect.width
  300.         #
  301.         if (mouse_x > top_x) and (mouse_x < bottom_x)
  302.           mouse_not_in_rect = false
  303.           break
  304.         end
  305.       end
  306.       if mouse_not_in_rect
  307.         @index = index_var
  308.         update_cursor_rect
  309.         Mouse.click_lock
  310.       else
  311.         Mouse.click_unlock
  312.       end
  313.     end
  314.     if @last_mouse_y == nil
  315.       @last_mouse_y = mouse_y
  316.     end
  317.     check_pos = (@last_mouse_y - mouse_y).abs
  318.     if check_pos > 10
  319.       $game_system.se_play($data_system.cursor_se)
  320.       place = 10 ** (@digits_max - 1 - @index)
  321.       n = [url=home.php?mod=space&uid=27178]@Number[/url] / place % 10
  322.       [url=home.php?mod=space&uid=27178]@Number[/url] -= n * place
  323.       n = (n + 1) % 10 if mouse_y < @last_mouse_y
  324.       n = (n + 9) % 10 if mouse_y > @last_mouse_y
  325.       [url=home.php?mod=space&uid=27178]@Number[/url] += n * place
  326.       refresh
  327.       @last_mouse_y = mouse_y
  328.     end
  329.   end
  330. end
  331. class Scene_File
  332.   if @self_alias == nil
  333.     alias self_update update
  334.     @self_alias = true
  335.   end
  336.   def update
  337.     mouse_x, mouse_y = Mouse.get_mouse_pos
  338.     Mouse.click_lock
  339.     idx = 0
  340.     for i in @savefile_windows
  341.       top_x = i.x + 16
  342.       top_y = i.y + 16
  343.       bottom_x = top_x + i.width
  344.       bottom_y = top_y + i.height
  345.       if (mouse_x > top_x) and (mouse_y > top_y) and
  346.          (mouse_x < bottom_x) and (mouse_y < bottom_y)
  347.         i.selected = true
  348.         if @file_index != idx
  349.           @file_index = idx
  350.           $game_system.se_play($data_system.cursor_se)
  351.         end            
  352.         Mouse.click_unlock
  353.       else
  354.         i.selected = false
  355.       end
  356.       idx += 1
  357.     end
  358.     self_update
  359.   end
  360. end
  361. class Arrow_Enemy
  362.   if @self_alias == nil
  363.     alias self_update update
  364.     @self_alias = true
  365.   end
  366.   def update
  367.     mouse_x, mouse_y = Mouse.get_mouse_pos
  368.     idx = 0
  369.     for i in $game_troop.enemies do
  370.       if i.exist?
  371.         top_x = i.screen_x - self.ox
  372.         top_y = i.screen_y - self.oy
  373.         bottom_x = top_x + self.src_rect.width
  374.         bottom_y = top_y + self.src_rect.height
  375.         if (mouse_x > top_x - $敌人选框扩大) and (mouse_y > top_y - $敌人选框扩大) and
  376.            (mouse_x < bottom_x + $敌人选框扩大) and (mouse_y < bottom_y + $敌人选框扩大)
  377.           if @index != idx
  378.             $game_system.se_play($data_system.cursor_se)
  379.             @index = idx
  380.           end
  381.         end
  382.       end
  383.       idx += 1
  384.     end
  385.     self_update
  386.   end
  387. end
  388. class Arrow_Actor
  389.   if @self_alias == nil
  390.     alias self_update update
  391.     @self_alias = true
  392.   end
  393.   def update
  394.     mouse_x, mouse_y = Mouse.get_mouse_pos
  395.     idx = 0
  396.     for i in $game_party.actors do
  397.       if i.exist?
  398.         top_x = i.screen_x - self.ox
  399.         top_y = i.screen_y - self.oy
  400.         bottom_x = top_x + self.src_rect.width
  401.         bottom_y = top_y + self.src_rect.height
  402.         if (mouse_x > top_x - $角色选框扩大) and (mouse_y > top_y - $角色选框扩大) and
  403.            (mouse_x < bottom_x + $角色选框扩大) and (mouse_y < bottom_y + $角色选框扩大)
  404.           if @index != idx
  405.             $game_system.se_play($data_system.cursor_se)
  406.             @index = idx
  407.           end
  408.         end
  409.       end
  410.       idx += 1
  411.     end
  412.     self_update
  413.   end
  414. end
  415. class Game_Player
  416.   if @self_alias == nil
  417.     alias self_update update
  418.     @self_alias = true
  419.   end
  420.   def update
  421.     mouse_x, mouse_y = Mouse.get_mouse_pos
  422.  
  423.     if @last_move_x == nil
  424.       @last_move_x = false
  425.     end
  426.     if $game_switches[$钓鱼系统]
  427.      if Mouse.press?(Mouse::LEFT)
  428.        for event in $game_map.events.values
  429.          if event.screen_x/32 == mouse_x/32 and event.screen_y/32-1 == mouse_y/32 and event.trigger==0
  430.            event.start unless $game_system.map_interpreter.running?
  431.          end
  432.        end
  433.      end
  434.      self_update
  435.      return
  436.    end
  437.  
  438.  
  439.     if Mouse.press?(Mouse::LEFT)
  440.       last_moving = moving?
  441.       last_direction = @direction
  442.       unless moving? or $game_system.map_interpreter.running? or
  443.              @move_route_forcing or $game_temp.message_window_showing
  444.         last_x = @x
  445.         if @last_move_x
  446.           @last_move_x = false
  447.         elsif mouse_x > screen_x + 16
  448.           move_right
  449.         elsif mouse_x < screen_x - 16
  450.           move_left
  451.         end
  452.         last_y = @y
  453.         if last_x != @x
  454.           @last_move_x = true
  455.         elsif mouse_y > screen_y
  456.           move_down
  457.         elsif mouse_y < screen_y - 32
  458.           move_up
  459.         end
  460.         if last_y != @y
  461.           @last_move_x = false
  462.         elsif not @last_move_x
  463.           case last_direction
  464.           when 2
  465.             turn_down
  466.           when 4
  467.             turn_left
  468.           when 6
  469.             turn_right
  470.           when 8
  471.             turn_up
  472.           end
  473.         end
  474.       end
  475.     end
  476.     self_update
  477.   end
  478. end
  479. Mouse.init
  480. END { Mouse.exit }
  481.  
  482.  
  483.  
  484.  
  485. #==============================================================================
  486. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  487. #==============================================================================

脚本盲一个,谁来帮我改一下搜索了一小时了,都没找到
如果头晕的话请下载工程 复件 Project8.7z (516.21 KB, 下载次数: 54)   
作者: 小和尚    时间: 2013-5-10 12:49
= = .. 什么叫把图片标题与脚本结合? 是说用鼠标点击开始 继续等选项可以执行吗? 如果是的话用鼠标响应图片脚本就好了吧0..
作者: 秋寒    时间: 2013-5-10 13:07
小和尚 发表于 2013-5-10 12:49
= = .. 什么叫把图片标题与脚本结合? 是说用鼠标点击开始 继续等选项可以执行吗? 如果是的话用鼠标响应图 ...

鼠标相应图片早装上去了,可关键是在标题又不是在地图。本来想用事件标题的,但还是觉得...
作者: 美丽晨露    时间: 2013-5-10 17:57
复制代码头晕中······
可以的话附上范例工程吧。
我来试试看
作者: 秋寒    时间: 2013-5-11 09:58
美丽晨露 发表于 2013-5-10 17:57
复制代码头晕中······
可以的话附上范例工程吧。
我来试试看 ...

复件 Project8.7z (516.21 KB, 下载次数: 45)
附件传上去了
作者: 美丽晨露    时间: 2013-5-11 10:43
1426 发表于 2013-5-11 09:58
附件传上去了

修改完毕.zip (577.84 KB, 下载次数: 82)

修改好了




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