查看: 3767|回复: 0

[原创发布] 横板的NDS

[复制链接]
梦石
0
星屑
1221
在线时间
10 小时
注册时间
2016-3-13
回帖
2
发表于 2016-3-16 19:23:04 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本脚本原来的作者:@欧买歌
不知道有人发布了没有
发布了请回复,谢谢。
脚本
  1. =begin
  2. 本脚本原作者:欧买歌
  3. 现在已经修改为横板。
  4. 但是无法实现渐变
  5. 所以还需要改进(原来没有尝试,不知道可不可以渐变)
  6. 本脚本来自66RPG,请勿转载!
  7. =end
  8. # ■ Graphics
  9. #------------------------------------------------------------------------------
  10. #  图像模块
  11. #==============================================================================

  12. #--------------------------------------------------------------------------
  13. # ● 更待指定帧数
  14. #--------------------------------------------------------------------------
  15. def Graphics.wait(n)
  16.   n.times{self.update;yield if defined? yield}
  17. end
  18. #--------------------------------------------------------------------------
  19. # ● 获取窗口宽
  20. #--------------------------------------------------------------------------
  21. def Graphics.width
  22.   @width ||= 640
  23. end
  24. #--------------------------------------------------------------------------
  25. # ● 获取窗口高
  26. #--------------------------------------------------------------------------
  27. def Graphics.height
  28.   @height ||= 480
  29. end
  30. #--------------------------------------------------------------------------
  31. # ● 更改窗口大小
  32. #--------------------------------------------------------------------------
  33. def Graphics.resize_screen(width, height)
  34.   @width  ||= 640
  35.   @height ||= 480
  36.   
  37.   游戏ini名=".\\Game.ini"
  38.   val = "\0"*256
  39.   gps = Win32API.new('kernel32', 'GetPrivateProfileString','pppplp', 'l')
  40.   gps.call("Game", "Title", "", val, 256, 游戏ini名)
  41.   val.delete!("\0")
  42.   title = val
  43.   fw = Win32API.new('user32', 'FindWindow', 'pp', 'i')
  44.   hWnd = fw.call("RGSS Player", title)
  45.   swp = Win32API.new('user32', 'SetWindowPos', 'lliiiii', 'i')
  46.   
  47.   pointwds = [0,0,0,0].pack('llll')
  48.   pointcet = [0, 0].pack('ll')

  49.   wdsrect = Win32API.new('user32.dll', 'GetWindowRect', 'lp', 'l')
  50.   client_screen = Win32API.new("user32", "ClientToScreen", 'ip', 'i')
  51.   
  52.   wdsrect.call(hWnd,pointwds)
  53.   client_screen.call(hWnd, pointcet)

  54.   wds = pointwds.unpack('llll')
  55.   cet = pointcet.unpack('ll')

  56.   addw =  wds[2] - wds[0] - @width
  57.   addh =  wds[3] - wds[1] - @height

  58.   x = wds[0] - (width - @width) / 2
  59.   y = wds[1] - (height - @height) / 2
  60.   
  61.   @width  = width
  62.   @height = height
  63.   
  64.   swp.call(hWnd, 0, x, y, @width + addw, @height + addh, 0x20)
  65. end
  66. Graphics.resize_screen(1280, 480)
  67. #==============================================================================
  68. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  69. #==============================================================================
  70. #==============================================================================
  71. # ■ Window_Help
  72. #------------------------------------------------------------------------------
  73. #  特技及物品的说明、角色的状态显示的窗口。
  74. #==============================================================================

  75. class Window_Help < Window_Base
  76.   #--------------------------------------------------------------------------
  77.   # ● 初始化对像
  78.   #--------------------------------------------------------------------------
  79.   def initialize
  80.     super(640, 0, 640, 64)
  81.     self.contents = Bitmap.new(width - 32, height - 32)
  82.   end
  83. end
  84. #==============================================================================
  85. # ■ Window_MenuStatus
  86. #------------------------------------------------------------------------------
  87. #  显示菜单画面和同伴状态的窗口。
  88. #==============================================================================

  89. class Window_MenuStatus < Window_Selectable
  90.   #--------------------------------------------------------------------------
  91.   # ● 初始化目标
  92.   #--------------------------------------------------------------------------
  93.   def initialize
  94.     super(0, 480, 480, 480)
  95.     self.contents = Bitmap.new(width - 32, height - 32)
  96.     refresh
  97.     self.active = false
  98.     self.index = -1
  99.   end
  100. end
  101. #==============================================================================
  102. # ■ Window_Item
  103. #------------------------------------------------------------------------------
  104. #  物品画面、战斗画面、显示浏览物品的窗口。
  105. #==============================================================================

  106. class Window_Item < Window_Selectable
  107.   #--------------------------------------------------------------------------
  108.   # ● 初始化对像
  109.   #--------------------------------------------------------------------------
  110.   def initialize
  111.     super(640, 64, 640, 416)
  112.     @column_max = 2
  113.     refresh
  114.     self.index = 0
  115.     # 战斗中的情况下将窗口移至中央并将其半透明化
  116.     if $game_temp.in_battle
  117.       self.y = 64
  118.       self.height = 256
  119.       self.back_opacity = 160
  120.     end
  121.   end
  122. end
  123. #==============================================================================
  124. # ■ Window_Skill
  125. #------------------------------------------------------------------------------
  126. #  特技画面、战斗画面、显示可以使用的特技浏览的窗口。
  127. #==============================================================================

  128. class Window_Skill < Window_Selectable
  129.   #--------------------------------------------------------------------------
  130.   # ● 初始化对像
  131.   #     actor : 角色
  132.   #--------------------------------------------------------------------------
  133.   def initialize(actor)
  134.     super(640, 128, 640, 352)
  135.     @actor = actor
  136.     @column_max = 2
  137.     refresh
  138.     self.index = 0
  139.     # 战斗中的情况下将窗口移至中央并将其半透明化
  140.     if $game_temp.in_battle
  141.       self.y = 64
  142.       self.height = 256
  143.       self.back_opacity = 160
  144.     end
  145.   end
  146. end
  147. #==============================================================================
  148. # ■ Window_SkillStatus
  149. #------------------------------------------------------------------------------
  150. #  显示特技画面、特技使用者的窗口。
  151. #==============================================================================

  152. class Window_SkillStatus < Window_Base
  153.   #--------------------------------------------------------------------------
  154.   # ● 初始化对像
  155.   #     actor : 角色
  156.   #--------------------------------------------------------------------------
  157.   def initialize(actor)
  158.     super(640, 64, 640, 64)
  159.     self.contents = Bitmap.new(width - 32, height - 32)
  160.     @actor = actor
  161.     refresh
  162.   end
  163. end
  164. #==============================================================================
  165. # ■ Window_Target
  166. #------------------------------------------------------------------------------
  167. #  物品画面与特技画面的、使用对像角色选择窗口。
  168. #==============================================================================

  169. class Window_Target < Window_Selectable
  170.   #--------------------------------------------------------------------------
  171.   # ● 初始化对像
  172.   #--------------------------------------------------------------------------
  173.   def initialize
  174.     super(640, 0, 336, 480)
  175.     self.contents = Bitmap.new(width - 32, height - 32)
  176.     self.z += 10
  177.     @item_max = $game_party.actors.size
  178.     refresh
  179.   end
  180. end
  181. #==============================================================================
  182. # ■ Window_EquipLeft
  183. #------------------------------------------------------------------------------
  184. #  装备画面的、显示角色能力值变化的窗口。
  185. #==============================================================================

  186. class Window_EquipLeft < Window_Base
  187.   #--------------------------------------------------------------------------
  188.   # ● 初始化对像
  189.   #     actor : 角色
  190.   #--------------------------------------------------------------------------
  191.   def initialize(actor)
  192.     super(640, 64, 272, 192)
  193.     self.contents = Bitmap.new(width - 32, height - 32)
  194.     @actor = actor
  195.     refresh
  196.   end
  197. end
  198. #==============================================================================
  199. # ■ Window_EquipRight
  200. #------------------------------------------------------------------------------
  201. #  装备画面、显示角色现在装备的物品的窗口。
  202. #==============================================================================

  203. class Window_EquipRight < Window_Selectable
  204.   #--------------------------------------------------------------------------
  205.   # ● 初始化对像
  206.   #     actor : 角色
  207.   #--------------------------------------------------------------------------
  208.   def initialize(actor)
  209.     super(272 + 640, 64, 368, 192)
  210.     self.contents = Bitmap.new(width - 32, height - 32)
  211.     @actor = actor
  212.     refresh
  213.     self.index = 0
  214.   end
  215. end
  216. #==============================================================================
  217. # ■ Window_EquipItem
  218. #------------------------------------------------------------------------------
  219. #  装备画面、显示浏览变更装备的候补物品的窗口。
  220. #==============================================================================

  221. class Window_EquipItem < Window_Selectable
  222.   #--------------------------------------------------------------------------
  223.   # ● 初始化对像
  224.   #     actor      : 角色
  225.   #     equip_type : 装备部位 (0~3)
  226.   #--------------------------------------------------------------------------
  227.   def initialize(actor, equip_type)
  228.     super(640, 256, 640, 224)
  229.     @actor = actor
  230.     @equip_type = equip_type
  231.     @column_max = 2
  232.     refresh
  233.     self.active = false
  234.     self.index = -1
  235.   end
  236. end
  237. #==============================================================================
  238. # ■ Window_Status
  239. #------------------------------------------------------------------------------
  240. #  显示状态画面、完全规格的状态窗口。
  241. #==============================================================================

  242. class Window_Status < Window_Base
  243.   #--------------------------------------------------------------------------
  244.   # ● 初始化对像
  245.   #     actor : 角色
  246.   #--------------------------------------------------------------------------
  247.   def initialize(actor)
  248.     super(640, 0, 640, 480)
  249.     self.contents = Bitmap.new(width - 32, height - 32)
  250.     @actor = actor
  251.     refresh
  252.   end
  253. end
  254. #==============================================================================
  255. # ■ Window_SaveFile
  256. #------------------------------------------------------------------------------
  257. #  显示存档以及读档画面、保存文件的窗口。
  258. #==============================================================================

  259. class Window_SaveFile < Window_Base
  260.   #--------------------------------------------------------------------------
  261.   # ● 初始化对像
  262.   #     file_index : 存档文件的索引 (0~3)
  263.   #     filename   : 文件名
  264.   #--------------------------------------------------------------------------
  265.   def initialize(file_index, filename)
  266.     super(640, 64 + file_index % 4 * 104, 640, 104)
  267.     self.contents = Bitmap.new(width - 32, height - 32)
  268.     @file_index = file_index
  269.     @filename = "Save/Save#{@file_index + 1}.Sav"
  270.     @time_stamp = Time.at(0)
  271.     @file_exist = FileTest.exist?(@filename)
  272.     if @file_exist
  273.       file = File.open(@filename, "r")
  274.       @time_stamp = file.mtime
  275.       @characters = Marshal.load(file)
  276.       @frame_count = Marshal.load(file)
  277.       @game_system = Marshal.load(file)
  278.       @game_switches = Marshal.load(file)
  279.       @game_variables = Marshal.load(file)
  280.       @total_sec = @frame_count / Graphics.frame_rate
  281.       file.close
  282.     end
  283.     refresh
  284.     @selected = false
  285.   end
  286. end
  287. #==============================================================================
  288. # ■ Scene_Menu
  289. #------------------------------------------------------------------------------
  290. #  处理菜单画面的类。
  291. #==============================================================================
  292. class Scene_Menu
  293.   #--------------------------------------------------------------------------
  294.   # ● 主处理
  295.   #--------------------------------------------------------------------------
  296.   def main
  297.     # 生成命令窗口
  298.     s1 = $data_system.words.item
  299.     s2 = $data_system.words.skill
  300.     s3 = $data_system.words.equip
  301.     s4 = "状态"
  302.     s5 = "存档"
  303.     s6 = "结束游戏"
  304.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
  305.     @command_window.index = @menu_index
  306.     @command_window.x = 640
  307.     @command_window.y = 0
  308.     # 同伴人数为 0 的情况下
  309.     if $game_party.actors.size == 0
  310.       # 物品、特技、装备、状态无效化
  311.       @command_window.disable_item(0)
  312.       @command_window.disable_item(1)
  313.       @command_window.disable_item(2)
  314.       @command_window.disable_item(3)
  315.     end
  316.     # 禁止存档的情况下
  317.     if $game_system.save_disabled
  318.       # 存档无效
  319.       @command_window.disable_item(4)
  320.     end
  321.     # 生成游戏时间窗口
  322.     @playtime_window = Window_PlayTime.new
  323.     @playtime_window.x = 640
  324.     @playtime_window.y = 224
  325.     # 生成步数窗口
  326.     @steps_window = Window_Steps.new
  327.     @steps_window.x = 640
  328.     @steps_window.y = 320
  329.     # 生成金钱窗口
  330.     @gold_window = Window_Gold.new
  331.     @gold_window.x = 640
  332.     @gold_window.y = 416
  333.     # 生成状态窗口
  334.     @status_window = Window_MenuStatus.new
  335.     @status_window.x = 160 + 640
  336.     @status_window.y = 0
  337.     # 执行过渡
  338.     Graphics.transition
  339.     # 主循环
  340.     loop do
  341.       # 刷新游戏画面
  342.       Graphics.update
  343.       # 刷新输入信息
  344.       Input.update
  345.       # 刷新画面
  346.       update
  347.       # 如果切换画面就中断循环
  348.       if $scene != self
  349.         break
  350.       end
  351.     end
  352.     # 准备过渡
  353.     Graphics.freeze
  354.     # 释放窗口
  355.     @command_window.dispose
  356.     @playtime_window.dispose
  357.     @steps_window.dispose
  358.     @gold_window.dispose
  359.     @status_window.dispose
  360.   end
  361. end
  362. class Scene_End
  363. def main
  364.     # 生成命令窗口
  365.     s1 = "返回标题画面"
  366.     s2 = "退出"
  367.     s3 = "取消"
  368.     @command_window = Window_Command.new(192, [s1, s2, s3])
  369.     @command_window.x = 320 - @command_window.width / 2 + 640
  370.     @command_window.y = 240 - @command_window.height / 2
  371.     # 执行过渡
  372.     Graphics.transition
  373.     # 主循环
  374.     loop do
  375.       # 刷新游戏画面
  376.       Graphics.update
  377.       # 刷新输入情报
  378.       Input.update
  379.       # 刷新画面
  380.       update
  381.       # 如果画面切换的话就中断循环
  382.       if $scene != self
  383.         break
  384.       end
  385.     end
  386.     # 准备过渡
  387.     Graphics.freeze
  388.     # 释放窗口
  389.     @command_window.dispose
  390.     # 如果在标题画面切换中的情况下
  391.     if $scene.is_a?(Scene_Title)
  392.       # 淡入淡出画面
  393.       Graphics.transition
  394.       Graphics.freeze
  395.     end
  396.   end
  397. end
  398. #==============================================================================
  399. # ■ Window_Base
  400. #==============================================================================

  401. class Window_Base < Window
  402.   alias xrxs_mp7_initialize initialize
  403.   def initialize(x, y, width, height)
  404.     xrxs_mp7_initialize(x, y, width, height)
  405.     if $scene.is_a?(Scene_Menu) or
  406.        $scene.is_a?(Scene_Item) or  
  407.        $scene.is_a?(Scene_Skill) or  
  408.        $scene.is_a?(Scene_Equip) or  
  409.        $scene.is_a?(Scene_Status) or  
  410.        $scene.is_a?(Scene_Save) or  
  411.        $scene.is_a?(Scene_End)
  412.       self.back_opacity = 255  #————这个数值可调,为透明程度
  413.     end
  414.   end
  415. end
  416. module XRXS_MP7_Module
  417.   def create_spriteset
  418.     @spriteset = Spriteset_Map.new
  419.   end
  420.   def dispose_spriteset
  421.     @spriteset.dispose
  422.   end
  423. end
  424. class Scene_Menu
  425.   include XRXS_MP7_Module
  426.   alias xrxs_mp7_main main
  427.   def main
  428.     create_spriteset
  429.     xrxs_mp7_main
  430.     dispose_spriteset
  431.   end
  432. end
  433. class Scene_Item
  434.   include XRXS_MP7_Module
  435.   alias xrxs_mp7_main main
  436.   def main
  437.     create_spriteset
  438.     xrxs_mp7_main
  439.     dispose_spriteset
  440.   end
  441. end
  442. class Scene_Skill
  443.   include XRXS_MP7_Module
  444.   alias xrxs_mp7_main main
  445.   def main
  446.     create_spriteset
  447.     xrxs_mp7_main
  448.     dispose_spriteset
  449.   end
  450. end
  451. class Scene_Equip
  452.   include XRXS_MP7_Module
  453.   alias xrxs_mp7_main main
  454.   def main
  455.     create_spriteset
  456.     xrxs_mp7_main
  457.     dispose_spriteset
  458.   end
  459. end
  460. class Scene_Status
  461.   include XRXS_MP7_Module
  462.   alias xrxs_mp7_main main
  463.   def main
  464.     create_spriteset
  465.     xrxs_mp7_main
  466.     dispose_spriteset
  467.   end
  468. end
  469. class Scene_Save
  470.   include XRXS_MP7_Module
  471.   alias xrxs_mp7_main main
  472.   def main
  473.     create_spriteset
  474.     xrxs_mp7_main
  475.     dispose_spriteset
  476.   end
  477. end
  478. class Scene_End
  479.   include XRXS_MP7_Module
  480.   alias xrxs_mp7_main main
  481.   def main
  482.     create_spriteset
  483.     xrxs_mp7_main
  484.     dispose_spriteset
  485.   end
  486. end
  487. #==============================================================================
  488. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  489. #==============================================================================
复制代码

能不能鼠标不要问我,我没试过加鼠标
本人第一次发帖,请踊跃批评我吧。( ^ω^)  

标题(什么都没有)

标题(什么都没有)

菜单(呵呵)

菜单(呵呵)

装备

装备

评分

参与人数 1星屑 +20 收起 理由
欧买歌 + 20 我很赞同

查看全部评分

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部