Project1

标题: 如何让工程外的game.exe在任务栏显示FPS [打印本页]

作者: jiahui5592986    时间: 2018-6-23 22:05
标题: 如何让工程外的game.exe在任务栏显示FPS
工程里面测试游戏,按F2可以开启FPS显示。
怎么让工程外的game程序默认就开启FPS呢。
如果可以的话,能不能在游戏中加一个开启/关闭FPS的开关呢
求大佬~~~
作者: 高王碎大石    时间: 2018-6-28 10:02
  1. class Window_FPS < Window_Base
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化对像
  4.   #--------------------------------------------------------------------------
  5.   def initialize
  6.     super(0, 0, 64,64)
  7.     self.contents = Bitmap.new(32, 32)
  8.    self.contents.font.color = Color.new(255, 255, 0, 255)
  9.     self.opacity = 0
  10.     @fps = 0  
  11.     @t = Time.now
  12.     @g = 0
  13.     refresh
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ● 刷新
  17.   #--------------------------------------------------------------------------
  18.   def refresh
  19.     self.contents.clear
  20.     if Time.now - @t >= 1
  21.       @fps = Graphics.frame_count - @g
  22.       @g = Graphics.frame_count
  23.       @t = Time.now
  24.     end
  25.     self.contents.draw_text(0, 0, 32, 32,@fps.to_s, 2)
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● 刷新画面
  29.   #--------------------------------------------------------------------------
  30.   def update
  31.     super
  32. if Graphics.frame_count - @g != @fps
  33.       refresh
  34.       end
  35.   end
  36. end
复制代码

搞了个显示fps的window
看着玩就行……233
溜了
作者: 失落的乐章    时间: 2018-6-30 19:07
一个思路:运行 Game.exe 时带上 debug 参数,然后用 keybd_event 模拟按下 F2……
作者: SixRC    时间: 2018-7-1 13:07
RUBY 代码复制
  1. # 不论是否debug状态 按下 F2 显示/不显示 FPS
  2. dll=Win32API.new('kernel32','GetModuleHandle','p','l').call('RGSS103J')
  3. Win32API.new('kernel32','WriteProcessMemory','llpll','l').call(-1,dll + 0x12B6C0,"\1",1,0)

不影响其余的debug功能
随便插在什么地方
不要这个功能了把那一字节改回去成0就行..

作者: Tsar_NicholasII    时间: 2018-7-6 22:28
请参考魔塔样板1224以上的角色状态窗口脚本格式




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1