winStay is a library that is used to easily keep window location and size persistent after closing the program. winStay has one function winStay
, which has three arguments:
name
is the name of the folder in which you want to keep the save data in within/appdata/
.width
is the default window width.height
is the default window height.
How to use winStay with yotta
After first installing Yotta, run the following commands:
> cd /ram/cart
> yotta init
> yotta add #lib_winstay-0
> yotta apply
Finally add the following code to the top of main.lua
.
include "./lib/_bbs_lib_winstay_0/winStay.lua" winStay("game", 150, 100) |
How to use winStay without yotta
Run the following commands in the console:
load #lib_winstay-0
cp /ram/cart/exports/winStay.lua desktop
Now load the program you wish to add winStay to, and move it from the desktop to the cart next to your main.lua
file.
Add the following code to the top of main.lua
:
include "winStay.lua" winStay("game", 150, 100) |
[Please log in to post a comment]