设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1367|回复: 2
打印 上一主题 下一主题

[已经解决] 分辨率调整后切换菜单窗口时淡入淡出的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2015-4-2
帖子
15
跳转到指定楼层
1
发表于 2015-4-2 19:16:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
我把分辨率调整为1024乘576之后,切换菜单窗口时的淡入淡出会发现明显的出现640乘480的黑色,而不是全屏,切换时很难看,我该怎么该?我把淡入淡出的值都改成1后,切换时还是飞快的闪出一个黑影。怎么办啊~~~

Lv3.寻梦者

梦石
0
星屑
3039
在线时间
1052 小时
注册时间
2011-8-16
帖子
242
2
发表于 2015-4-4 21:43:32 | 只看该作者
请尝试使用此脚本:
  1. #==============================================================================
  2. # ** Drago - Core Engine
  3. # Version : 1.39
  4. # Contact : littledrago.blogspot.com / forum.chaos-project.com
  5. #==============================================================================
  6. # =============================================================================
  7. # NOTE:
  8. # -----------------------------------------------------------------------------
  9. # This is a devtool for me to make me easier for scripting
  10. # If you want to use this, put above all custom script & below Scene_Debug
  11. #
  12. # Note that I'm changing a bit RGSS language in this script, so probably some
  13. # syntax in this script won't work if you use them somewhere else
  14. #
  15. # =============================================================================
  16. module LiTTleDRAgo
  17.   #-------------------------------------------------------------------------
  18.   # * Constant
  19.   #-------------------------------------------------------------------------
  20.   VX           = defined?(Window_ActorCommand)
  21.   VXA          = defined?(Window_BattleActor)
  22.   RGSS1        = defined?(Hangup)
  23.   RGSS2        = RUBY_VERSION == '1.8.1' && !RGSS1
  24.   RGSS3        = RUBY_VERSION == '1.9.2'
  25.   APPPATHDRAGO = "#{ENV['APPDATA']}/Drago/"
  26. end

  27. #==============================================================================
  28. # ** CoreDLL
  29. #------------------------------------------------------------------------------
  30. #  
  31. #==============================================================================
  32. module CoreDLL
  33.   #-------------------------------------------------------------------------
  34.   # * Constant
  35.   #-------------------------------------------------------------------------
  36.   Rtlmemory_pi = Win32API.new('kernel32','RtlMoveMemory','pii','i')
  37.   Rtlmemory_ip = Win32API.new('kernel32','RtlMoveMemory','ipi','i')
  38.   #-------------------------------------------------------------------------
  39.   # * Get the game window handle (specific to game)
  40.   #-------------------------------------------------------------------------
  41.   unless method_defined?(:hwnd)
  42.     def hwnd
  43.       @window_find ||= Win32API.new('user32', 'FindWindowEx', %w(l l p p), 'i')
  44.       @game_window ||= @window_find.call(0,0,"RGSS Player",0)
  45.       return @game_window
  46.     end  
  47.   end
  48.   #-------------------------------------------------------------------------
  49.   # * Get the Game Window's width and height
  50.   #-------------------------------------------------------------------------
  51.   unless method_defined?(:client_size)
  52.     def client_size
  53.       @window_c_rect ||= Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
  54.       @window_c_rect.call(self.hwnd, (rect = [0, 0, 0, 0].pack('l4')))
  55.       right, bottom = rect.unpack('l4')[2..3]
  56.       return right, bottom
  57.     end  
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # * snap_to_bitmap
  61.   #--------------------------------------------------------------------------
  62.   unless method_defined?(:snap_to_bitmap)
  63.     def snap_to_bitmap
  64.       @getdc         ||= Win32API.new('user32','GetDC','i','i')
  65.       @ccdc          ||= Win32API.new('gdi32','CreateCompatibleDC','i','i')
  66.       @ccbitmap      ||= Win32API.new('gdi32','CreateCompatibleBitmap','iii','i')
  67.       @deleteobject  ||= Win32API.new('gdi32','DeleteObject','i','i')
  68.       @bitblt        ||= Win32API.new('gdi32','BitBlt','iiiiiiiii','i')
  69.       @setdibits     ||= Win32API.new('gdi32','SetDIBits','iiiiipi','i')
  70.       @getdibits     ||= Win32API.new('gdi32','GetDIBits','iiiiipi','i')
  71.       @selectobject  ||= Win32API.new('gdi32','SelectObject','ii','i')
  72.       width, height = Graphics.width, Graphics.height
  73.       bitmap        = Bitmap.new(width, height)
  74.       info          = [40,width,height,1,32,0,0,0,0,0,0].pack('LllSSLLllLL')
  75.       hDC           = @ccdc.call((dc = @getdc.call(hwnd)))
  76.       hBM           = @ccbitmap.call(dc, width, height)
  77.       @deleteobject.call(@selectobject.call(hDC, hBM))
  78.       @setdibits.call(hDC, hBM, 0, height, (address = bitmap.address), info, 0)
  79.       @bitblt.call(hDC, 0, 0, width, height, dc, 0, 0, 0xCC0020)
  80.       @getdibits.call(hDC, hBM, 0, height, address, info, 0)
  81.       @deleteobject.call(hBM)
  82.       @deleteobject.call(hDC)
  83.       bitmap
  84.     end   
  85.   end
  86. end                        
  87. LiTTleDRAgo.extend(CoreDLL)

  88. #==============================================================================
  89. # ** Graphics
  90. #------------------------------------------------------------------------------
  91. #  This module handles all Graphics
  92. #==============================================================================
  93. module Graphics
  94.   #----------------------------------------------------------------------------
  95.   # ● class << self
  96.   #----------------------------------------------------------------------------
  97.   class << self
  98.     #--------------------------------------------------------------------------
  99.     # ● Redefined method: width, height, snap_to_bitmap
  100.     #--------------------------------------------------------------------------
  101.     unless method_defined?(:width)
  102.       def width
  103.         LiTTleDRAgo.client_size.at(0)
  104.       end
  105.     end
  106.    
  107.     unless method_defined?(:height)
  108.       def height
  109.         LiTTleDRAgo.client_size.at(1)
  110.       end
  111.     end
  112.    
  113.     unless method_defined?(:snap_to_bitmap)
  114.       def snap_to_bitmap
  115.         LiTTleDRAgo.snap_to_bitmap
  116.       end
  117.     end
  118.   end
  119. end
  120. #==============================================================================
  121. # ■ Bitmap
  122. #------------------------------------------------------------------------------
  123. #
  124. #==============================================================================
  125. class Bitmap  
  126.   #----------------------------------------------------------------------------
  127.   # ● Constant
  128.   #----------------------------------------------------------------------------
  129.   RtlMoveMemory_pi = CoreDLL::Rtlmemory_pi
  130.   RtlMoveMemory_ip = CoreDLL::Rtlmemory_ip
  131.   #----------------------------------------------------------------------------
  132.   # ● New method: address
  133.   #----------------------------------------------------------------------------
  134.   unless method_defined?(:address)
  135.     def address
  136.       @address ||= (
  137.         RtlMoveMemory_pi.call(a="\0"*4, __id__*2+16, 4)
  138.         RtlMoveMemory_pi.call(a, a.unpack('L')[0]+8, 4)
  139.         RtlMoveMemory_pi.call(a, a.unpack('L')[0]+16, 4)
  140.         a.unpack('L')[0]
  141.       )
  142.     end
  143.   end
  144. end
  145. #===============================================================================
  146. # **                                               END OF Drago - Core Engine
  147. #===============================================================================

  148. #===============================================================================
  149. # ** Graphics
  150. #===============================================================================

  151. module Graphics

  152.   class << self
  153.     alias zer0_graphics_transition transition unless $@
  154.   end

  155.   def self.transition(duration = 8, *args)
  156.       # Skip this section and instantly transition graphics if duration is 0.
  157.       if duration > 0
  158.         # Take a snapshot of the the screen, overlaying screen with graphic.
  159.         #$resolution.snapshot
  160.         zer0_graphics_transition(0)
  161.         # Create screen instance
  162.         sprite = Sprite.new(Viewport.new(0, 0, 1024, 576))
  163.         sprite.bitmap = Graphics.snap_to_bitmap
  164.         # Use a simple fade if transition is not defined.
  165.         fade = 255 / duration
  166.         duration.times { sprite.opacity -= fade ; update }
  167.         # Dispose sprite and delete snapshot file.
  168.         [sprite, sprite.bitmap].each {|obj| obj.dispose }
  169.         #File.delete('Data/snap')
  170.       end
  171.      zer0_graphics_transition(0)
  172.    end
  173. end  
复制代码
我自己还没有测试过。这个脚本是我从外站找来的,删去了和渐变处理无关的部分。原作者是LiTTleDRAgo和ForeverZer0.

评分

参与人数 1星屑 +150 收起 理由
RyanBern + 150 认可答案

查看全部评分

回复 支持 1 反对 0

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
37 小时
注册时间
2015-4-2
帖子
15
3
 楼主| 发表于 2015-4-6 01:40:59 | 只看该作者
失落的乐章 发表于 2015-4-4 21:43
请尝试使用此脚本:我自己还没有测试过。这个脚本是我从外站找来的,删去了和渐变处理无关的部分。原作者是 ...

真的是非常感谢!!!用了这个脚本以后尽管没有渐变效果,只是淡出淡入,但是总别原来的一块好多了,太棒啦!!!!!(ΦωΦ)(σ゚∀゚)σ
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-19 09:14

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表