Project1
标题:
分辨率调整后切换菜单窗口时淡入淡出的问题
[打印本页]
作者:
kishonlee
时间:
2015-4-2 19:16
标题:
分辨率调整后切换菜单窗口时淡入淡出的问题
我把分辨率调整为1024乘576之后,切换菜单窗口时的淡入淡出会发现明显的出现640乘480的黑色,而不是全屏,切换时很难看,我该怎么该?我把淡入淡出的值都改成1后,切换时还是飞快的闪出一个黑影。怎么办啊~~~
作者:
失落的乐章
时间:
2015-4-4 21:43
请尝试使用此脚本:
#==============================================================================
# ** Drago - Core Engine
# Version : 1.39
# Contact : littledrago.blogspot.com / forum.chaos-project.com
#==============================================================================
# =============================================================================
# NOTE:
# -----------------------------------------------------------------------------
# This is a devtool for me to make me easier for scripting
# If you want to use this, put above all custom script & below Scene_Debug
#
# Note that I'm changing a bit RGSS language in this script, so probably some
# syntax in this script won't work if you use them somewhere else
#
# =============================================================================
module LiTTleDRAgo
#-------------------------------------------------------------------------
# * Constant
#-------------------------------------------------------------------------
VX = defined?(Window_ActorCommand)
VXA = defined?(Window_BattleActor)
RGSS1 = defined?(Hangup)
RGSS2 = RUBY_VERSION == '1.8.1' && !RGSS1
RGSS3 = RUBY_VERSION == '1.9.2'
APPPATHDRAGO = "#{ENV['APPDATA']}/Drago/"
end
#==============================================================================
# ** CoreDLL
#------------------------------------------------------------------------------
#
#==============================================================================
module CoreDLL
#-------------------------------------------------------------------------
# * Constant
#-------------------------------------------------------------------------
Rtlmemory_pi = Win32API.new('kernel32','RtlMoveMemory','pii','i')
Rtlmemory_ip = Win32API.new('kernel32','RtlMoveMemory','ipi','i')
#-------------------------------------------------------------------------
# * Get the game window handle (specific to game)
#-------------------------------------------------------------------------
unless method_defined?(:hwnd)
def hwnd
@window_find ||= Win32API.new('user32', 'FindWindowEx', %w(l l p p), 'i')
@game_window ||= @window_find.call(0,0,"RGSS Player",0)
return @game_window
end
end
#-------------------------------------------------------------------------
# * Get the Game Window's width and height
#-------------------------------------------------------------------------
unless method_defined?(:client_size)
def client_size
@window_c_rect ||= Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
@window_c_rect.call(self.hwnd, (rect = [0, 0, 0, 0].pack('l4')))
right, bottom = rect.unpack('l4')[2..3]
return right, bottom
end
end
#--------------------------------------------------------------------------
# * snap_to_bitmap
#--------------------------------------------------------------------------
unless method_defined?(:snap_to_bitmap)
def snap_to_bitmap
@getdc ||= Win32API.new('user32','GetDC','i','i')
@ccdc ||= Win32API.new('gdi32','CreateCompatibleDC','i','i')
@ccbitmap ||= Win32API.new('gdi32','CreateCompatibleBitmap','iii','i')
@deleteobject ||= Win32API.new('gdi32','DeleteObject','i','i')
@bitblt ||= Win32API.new('gdi32','BitBlt','iiiiiiiii','i')
@setdibits ||= Win32API.new('gdi32','SetDIBits','iiiiipi','i')
@getdibits ||= Win32API.new('gdi32','GetDIBits','iiiiipi','i')
@selectobject ||= Win32API.new('gdi32','SelectObject','ii','i')
width, height = Graphics.width, Graphics.height
bitmap = Bitmap.new(width, height)
info = [40,width,height,1,32,0,0,0,0,0,0].pack('LllSSLLllLL')
hDC = @ccdc.call((dc = @getdc.call(hwnd)))
hBM = @ccbitmap.call(dc, width, height)
@deleteobject.call(@selectobject.call(hDC, hBM))
@setdibits.call(hDC, hBM, 0, height, (address = bitmap.address), info, 0)
@bitblt.call(hDC, 0, 0, width, height, dc, 0, 0, 0xCC0020)
@getdibits.call(hDC, hBM, 0, height, address, info, 0)
@deleteobject.call(hBM)
@deleteobject.call(hDC)
bitmap
end
end
end
LiTTleDRAgo.extend(CoreDLL)
#==============================================================================
# ** Graphics
#------------------------------------------------------------------------------
# This module handles all Graphics
#==============================================================================
module Graphics
#----------------------------------------------------------------------------
# ● class << self
#----------------------------------------------------------------------------
class << self
#--------------------------------------------------------------------------
# ● Redefined method: width, height, snap_to_bitmap
#--------------------------------------------------------------------------
unless method_defined?(:width)
def width
LiTTleDRAgo.client_size.at(0)
end
end
unless method_defined?(:height)
def height
LiTTleDRAgo.client_size.at(1)
end
end
unless method_defined?(:snap_to_bitmap)
def snap_to_bitmap
LiTTleDRAgo.snap_to_bitmap
end
end
end
end
#==============================================================================
# ■ Bitmap
#------------------------------------------------------------------------------
#
#==============================================================================
class Bitmap
#----------------------------------------------------------------------------
# ● Constant
#----------------------------------------------------------------------------
RtlMoveMemory_pi = CoreDLL::Rtlmemory_pi
RtlMoveMemory_ip = CoreDLL::Rtlmemory_ip
#----------------------------------------------------------------------------
# ● New method: address
#----------------------------------------------------------------------------
unless method_defined?(:address)
def address
@address ||= (
RtlMoveMemory_pi.call(a="\0"*4, __id__*2+16, 4)
RtlMoveMemory_pi.call(a, a.unpack('L')[0]+8, 4)
RtlMoveMemory_pi.call(a, a.unpack('L')[0]+16, 4)
a.unpack('L')[0]
)
end
end
end
#===============================================================================
# ** END OF Drago - Core Engine
#===============================================================================
#===============================================================================
# ** Graphics
#===============================================================================
module Graphics
class << self
alias zer0_graphics_transition transition unless $@
end
def self.transition(duration = 8, *args)
# Skip this section and instantly transition graphics if duration is 0.
if duration > 0
# Take a snapshot of the the screen, overlaying screen with graphic.
#$resolution.snapshot
zer0_graphics_transition(0)
# Create screen instance
sprite = Sprite.new(Viewport.new(0, 0, 1024, 576))
sprite.bitmap = Graphics.snap_to_bitmap
# Use a simple fade if transition is not defined.
fade = 255 / duration
duration.times { sprite.opacity -= fade ; update }
# Dispose sprite and delete snapshot file.
[sprite, sprite.bitmap].each {|obj| obj.dispose }
#File.delete('Data/snap')
end
zer0_graphics_transition(0)
end
end
复制代码
我自己还没有测试过。这个脚本是我从外站找来的,删去了和渐变处理无关的部分。原作者是LiTTleDRAgo和ForeverZer0.
作者:
kishonlee
时间:
2015-4-6 01:40
失落的乐章 发表于 2015-4-4 21:43
请尝试使用此脚本:我自己还没有测试过。这个脚本是我从外站找来的,删去了和渐变处理无关的部分。原作者是 ...
真的是非常感谢!!!用了这个脚本以后尽管没有渐变效果,只是淡出淡入,但是总别原来的一块好多了,太棒啦!!!!!(ΦωΦ)(σ゚∀゚)σ
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1