查看: 10141|回复: 15

[原创发布] 仿NDS双屏

[复制链接]

【欧皇】

梦石
3
星屑
2055
在线时间
1004 小时
注册时间
2013-8-19
回帖
3040

开拓者

发表于 2015-2-9 20:31:18 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 欧买歌 于 2015-2-11 17:54 编辑

脚本插♂入在Main前即可,未经深♂入测试,有BUG请提出!!!!
如果你想要触屏效果的话请自行加鼠标脚本= =
下面黑屏那块大家还可以加入各种元素
脚本
  1. #==============================================================================
  2. # ● 本脚本来自rm.66RPG.com,@欧买歌
  3. #==============================================================================
  4. #===========使用和转载请保留以上信息==========================================
  5. #==============================================================================
  6. #==============================================================================
  7. #===========以下是脚本内容,不懂请勿修改=======================================
  8. #==============================================================================
  9. # ■ Graphics
  10. #------------------------------------------------------------------------------
  11. #  图像模块
  12. #==============================================================================

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  363. #==============================================================================
  364. # ■ Window_Base
  365. #==============================================================================

  366. class Window_Base < Window
  367.   alias xrxs_mp7_initialize initialize
  368.   def initialize(x, y, width, height)
  369.     xrxs_mp7_initialize(x, y, width, height)
  370.     if $scene.is_a?(Scene_Menu) or
  371.        $scene.is_a?(Scene_Item) or  
  372.        $scene.is_a?(Scene_Skill) or  
  373.        $scene.is_a?(Scene_Equip) or  
  374.        $scene.is_a?(Scene_Status) or  
  375.        $scene.is_a?(Scene_Save) or  
  376.        $scene.is_a?(Scene_End)
  377.       self.back_opacity = 255  #————这个数值可调,为透明程度
  378.     end
  379.   end
  380. end
  381. module XRXS_MP7_Module
  382.   def create_spriteset
  383.     @spriteset = Spriteset_Map.new
  384.   end
  385.   def dispose_spriteset
  386.     @spriteset.dispose
  387.   end
  388. end
  389. class Scene_Menu
  390.   include XRXS_MP7_Module
  391.   alias xrxs_mp7_main main
  392.   def main
  393.     create_spriteset
  394.     xrxs_mp7_main
  395.     dispose_spriteset
  396.   end
  397. end
  398. class Scene_Item
  399.   include XRXS_MP7_Module
  400.   alias xrxs_mp7_main main
  401.   def main
  402.     create_spriteset
  403.     xrxs_mp7_main
  404.     dispose_spriteset
  405.   end
  406. end
  407. class Scene_Skill
  408.   include XRXS_MP7_Module
  409.   alias xrxs_mp7_main main
  410.   def main
  411.     create_spriteset
  412.     xrxs_mp7_main
  413.     dispose_spriteset
  414.   end
  415. end
  416. class Scene_Equip
  417.   include XRXS_MP7_Module
  418.   alias xrxs_mp7_main main
  419.   def main
  420.     create_spriteset
  421.     xrxs_mp7_main
  422.     dispose_spriteset
  423.   end
  424. end
  425. class Scene_Status
  426.   include XRXS_MP7_Module
  427.   alias xrxs_mp7_main main
  428.   def main
  429.     create_spriteset
  430.     xrxs_mp7_main
  431.     dispose_spriteset
  432.   end
  433. end
  434. class Scene_Save
  435.   include XRXS_MP7_Module
  436.   alias xrxs_mp7_main main
  437.   def main
  438.     create_spriteset
  439.     xrxs_mp7_main
  440.     dispose_spriteset
  441.   end
  442. end
  443. class Scene_End
  444.   include XRXS_MP7_Module
  445.   alias xrxs_mp7_main main
  446.   def main
  447.     create_spriteset
  448.     xrxs_mp7_main
  449.     dispose_spriteset
  450.   end
  451. end
  452. #==============================================================================
  453. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  454. #==============================================================================
复制代码

截图 2345截图20150209202415.png
2345截图20150209202336.png
2345截图20150209202318.png
2345截图20150209202249.png
2345截图20150209202235.png
范例.zip (204.64 KB, 下载次数: 234)
给点糖糖吧 A033.gif         

评分

参与人数 6星屑 +66 收起 理由
1041235896 + 1 66
墨凌羽 + 15 精品文章
英顺的马甲 + 10 这玩起来有多费劲啊==
rpg-sheep + 10 塞糖
david_ng223 + 20 塞糖
喜阳阳 + 10 塞糖

查看全部评分

QQ:2223942063
Q群:365819625
贪吃方1.4
david_ng223 该用户已被删除
发表于 2015-2-9 21:05:28 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2015-2-9 21:14:58 | 显示全部楼层
这个双屏的组合方式有一点莫名其妙···

点评

口袋妖怪黑2就是这样的,我都玩到三周目了(pia  发表于 2015-2-9 21:19
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

炎

梦石
0
星屑
98
在线时间
1617 小时
注册时间
2013-8-15
回帖
4322
发表于 2015-2-9 21:26:13 | 显示全部楼层
6) 允许设置1经验收费附件,用于查看下载明细;但是如果附件售价>1经验,无论是否有人下载,原则上不会再发奖励(非常优秀非常实用的发布例外)。

点评

还真的没有奖励!只能收回了……  发表于 2015-2-9 22:31
卧槽!  发表于 2015-2-9 22:31
纳尼?  发表于 2015-2-9 22:03
神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦神烦
回复

使用道具 举报

梦石
0
星屑
155
在线时间
478 小时
注册时间
2011-3-5
回帖
231
发表于 2015-2-10 17:23:58 | 显示全部楼层
我也觉得有些奇妙……
下屏不打开菜单什么的就纯黑了么……不过不显示地图也是挺好的。
话说NDS下屏可触控啊hhhhhh

点评

用鼠标脚本就可以了  发表于 2015-2-10 20:53
回复

使用道具 举报

梦石
0
星屑
757
在线时间
469 小时
注册时间
2013-8-3
回帖
853
发表于 2015-2-10 17:54:00 | 显示全部楼层
下屏触控,再加虚拟按键就完美了哈哈(奢望)

点评

用鼠标脚本就可以了  发表于 2015-2-10 20:53
貌似怪可能不触,但貌似怪会努力脱离渣的
回复

使用道具 举报

梦石
0
星屑
34460
在线时间
5096 小时
注册时间
2012-11-19
回帖
4715

开拓者

发表于 2015-2-11 12:19:19 | 显示全部楼层
可以再优化一下啊。比如在标题场景下面的黑屏那块,可以显示些游戏信息什么的;
在地图场景黑屏那儿可显示些角色头像血条,或者小地图什么的,,,。

点评

自行加啊,我又不知道你想要加什么  发表于 2015-2-11 17:44
xp vx va mv  va mz 各类型脚本/插件定制
回复

使用道具 举报

梦石
0
星屑
1918
在线时间
380 小时
注册时间
2012-12-10
回帖
402
发表于 2015-2-12 21:16:54 | 显示全部楼层
做这个有什么意思么……
『我对你矢志不渝。』
回复

使用道具 举报

梦石
0
星屑
1032
在线时间
145 小时
注册时间
2013-10-16
回帖
254
发表于 2015-2-12 21:55:29 | 显示全部楼层
能加入横向分布和竖向分布的功能么?
表示笔记本君1920*1024很不满。。。两边各空着1/3,下面的任务栏也挡住了游戏视窗。。
更何况1920*1080已经算是很高的分辨率了,还有些人在用1024*768。。。
建议(我知道实现起来有些困难,毕竟VA视窗做的也挺多了)
可不可以实现两个屏幕的大小不一致?
最后支持楼主做的越来越好~

点评

支持1366×768  发表于 2015-7-16 21:58
开心咸鱼每一天~
回复

使用道具 举报

梦石
0
星屑
630
在线时间
0 小时
注册时间
2015-7-16
回帖
1
发表于 2015-7-16 19:30:56 | 显示全部楼层
楼主,怎么把屏幕变小???、

点评

第72行,不过改了之后其它窗口需要再调一次  发表于 2015-7-16 19:44
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部