# 设置窗口大小
function SetWindowSize takes integer width, integer height returns nothing
1
# 描述
修改窗口大小 可以强行限制用户 窗口模式下的 窗口比例 16/9
# 参数
| 类型 | 名字 | 说明 | 
|---|---|---|
| 整数 | width | 窗口宽度 | 
| 整数 | height | 窗口高度 | 
# 返回值
| 类型 | 说明 | 
|---|---|
| 整数 | 控件地址 | 
# 例子
call SetWindowSize(1024, 768)
1
2
2
local japi = require 'jass.japi'
local GetWindowWidth = japi.GetWindowWidth
local GetWindowHeight = japi.GetWindowHeight
local IsWindowMode = japi.IsWindowMode
local SetWindowSize = japi.SetWindowSize
--窗口模式下 强行 16:9
ac.loop(33, function ()
    local w, h = GetWindowWidth(), GetWindowHeight()
    if  w / h ~= 16 / 9 and (IsWindowMode()) then 
        SetWindowSize(h / 9 * 16, h)
    end 
end)
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18