Shotgun King: The Final Checkmate

Shotgun King: The Final Checkmate

评价数不足
Window Helper
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
6.878 KB
2024 年 12 月 26 日 下午 12:46
6 月 17 日 下午 1:48
2 项改动说明 ( 查看 )

订阅以下载
Window Helper

描述
A library about windows

Usage
Define the WINDOW global as a list with an arbitrary amount of the following data:

Name
Description
Type
Required
Default
width
The width of the window
number
true
320
height
The height of the window
number
true
120
name
The name of the window
string
false
(generates a random name)
draw
The drawing function
function
false
nil
update
The update function
function
false
nil
enable
If the window should be enabled this frame
boolean
false
false
disable
If the window should be disabled this frame
boolean
false
false
scale
The window's scale
number
false
1
wmode
The window mode of the window
"resize" or "fullscreen" or "borderless" or "fixed"
false
"resize"
smode
The screen mode of the window
"resize" or "intscale" or "stretch" or "fixed" or "scale"
false
"scale"
shader
Path to shader file
string
false
nil

If you can't know how many windows your mod will need, you can always WINDOW.add(), which will return a window table as define above, using the defaults column.
The width & height default comes from Shutgun King itself, as it's own window is 320x120.

Moreover, if you want to change more specifics about the window, you can call the window's winspec function like so:
WINDOW[1].winspec("on_close", function() end)
This will work even if the window is not enabled, as the library will just save them until the window will be created.

Example
Here is some example WINDOW definition:
WINDOW={ { name = "Statistics", width = 240, height = 120, scale = 3 } }
This definition will, once enabled, create a window named "Statistics", of size 240x120, scaled 3 times.

WINDOW={ { name = "Window 1", width = 420, height = 210 }, { name = "Window 2", width = 30, height = 100, scale = 1,5 } }
This definition will create 2 windows, One will be named "Window 1" with a size of 420x210, and a second window named "Window 2", of size 30x100 with a scale of 1,5

热门讨论 查看全部(1)
0
6 月 29 日 下午 4:11
置顶: Report bugs here!
5jiji