Log In  

Cart #lib_winstay-1 | 2024-03-18 | Embed ▽ | License: CC4-BY-NC-SA
1

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:

  1. > cd /ram/cart
  2. > yotta init
  3. > yotta add #lib_winstay-0
  4. > 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:

  1. load #lib_winstay-0
  2. 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)
P#143669 2024-03-18 09:34


[Please log in to post a comment]