查看: 2831|回复: 2

[已经解决] 用过窗口放大脚本后,屏幕会闪

[复制链接]
梦石
0
星屑
50
在线时间
14 小时
注册时间
2015-4-10
回帖
6
发表于 2016-4-24 20:54:27 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 过焕 于 2016-4-24 20:57 编辑

抱歉发错区了,是va的,麻烦版主移一下....抱歉
——————————————————————————
测试游戏和打开游戏时都会默认全屏,但是一直在闪。
删了脚本也没有变回来,重新卸载va和创建新的工程也还是这样。请问该怎么办才好?
代码此贴2楼
https://rpg.blue/thread-373107-1-1.html

[pre lang="ruby"]# 按 F5 可以放大缩小窗口,存档记录玩家的偏好
class << Input
  alias_method :update_sion_zrscreen, :update
  def update
    Graphics.switch_room if trigger?(:F5)
    update_sion_zrscreen
  end
end
class << Graphics
  FindWindowEx = Win32API.new('user32', 'FindWindowEx', 'llpp', 'i')
  GetSysMtr    = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
  KeybdEvent   = Win32API.new('user32', 'keybd_event', 'iill', 'v')
  SetWindowPos = Win32API.new('user32', 'SetWindowPos', 'liiiiip', 'i')
  HWnd = FindWindowEx.call(0, 0, 'RGSS Player', 0)
  #
  def switch_room
    zoom($game_system.zoom_rate == 2 ? 1 : 2)
  end
  def zoom(rate)
    $game_system.zoom_rate = rate
    __zoom__(width * rate, height * rate)
  end
  def reset
    SetWindowPos.call(HWnd, 0, 0, 0, GetSysMtr.call(0), GetSysMtr.call(1), 0)
  end
  #
  def full_screen
    __toggle__ if GetSysMtr.call(0) > 640
  end
  def windowed
    __toggle__ if GetSysMtr.call(0) < 640
  end
private
  def __zoom__(w, h)
    w += (GetSysMtr.call(5) + GetSysMtr.call(45)) * 2
    h += (GetSysMtr.call(5) + GetSysMtr.call(45)) * 2 + GetSysMtr.call(4)
    x = [0, GetSysMtr.call(0) - w].max / 2
    y = [0, GetSysMtr.call(1) - h].max / 2
    SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
  end
  def __toggle__
    KeybdEvent.call(0xA4, 0, 0, 0)
    KeybdEvent.call(0x0D, 0, 0, 0)
    KeybdEvent.call(0x0D, 0, 2, 0)
    KeybdEvent.call(0xA4, 0, 2, 0)
  end
end

class Game_System
  attr_accessor :zoom_rate
  alias_method :on_after_load_sion_zrscreen, :on_after_load
  def on_after_load
    Graphics.zoom(@zoom_rate || 1)
    on_after_load_sion_zrscreen
  end
end
[/pre]
梦石
1
星屑
22083
在线时间
4885 小时
注册时间
2014-12-22
回帖
1509

开拓者

发表于 2016-4-25 12:04:36 | 显示全部楼层
貌似是显卡问题?切到集显看看(不记得了⋯⋯可以试下)或者更新一下显卡驱动之类的。
回复

使用道具 举报

梦石
0
星屑
1297
在线时间
995 小时
注册时间
2014-12-14
回帖
2939

开拓者

发表于 2016-4-25 22:51:30 | 显示全部楼层
好像以前见到过类似帖子,但因自己没有这种情况,故没有在意。尝试更新下显卡驱动可?

代替阁下搜索过了:
https://rpg.blue/forum.php?mod=viewthread&tid=324410
“新手礼包”
【点此获取】

评分

参与人数 1梦石 +1 收起 理由
丿梁丶小柒 + 1 认可答案

查看全部评分

【RMVA教程】
---------------------
欲买桂花同载酒,终不似,少年游.
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部