RUBY 代码 - module Extra
- module_function
- #---------------------游戏窗口居中-------------------------------#
- Desktop_hwnd=Win32API.new("user32","GetDesktopWindow",'v','l').call
- Win_hwnd=Win32API.new("user32","GetActiveWindow",'v','L').call
- def Put_to_center()
- size=' '*16
- Win32API.new("user32","GetWindowRect",'lp','v').call(Desktop_hwnd,size)
- size=size.unpack('l*')
- size_x=size[2]*3/5
- size_y=size[3]*4/5
- size_l=size[2]*1/5
- size_u=size[3]*1/11
- Win32API.new("user32","MoveWindow",%(llllll),'l').call(Win_hwnd,size_l,size_u,size_x,size_y,1)
- end
- end
复制代码
随便插进去
调用是 Extra.Put_to_center
自己看脚本即可 不解释
@jiahui5592986
本帖来自P1论坛作者SixRC,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址: https://rpg.blue/forum.php?mod=viewthread&tid=381919 若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。 |