MrBounty / PZ-UI_API

UI API for the game project zomboid
17 stars 4 forks source link

Example of using toggle? #2

Closed toastonrye closed 17 hours ago

toastonrye commented 1 year ago

I can't figure out how to toggle the UI.

To have the UI work like the inventory UI in the base game, clicking it opens, clicking again closes.

MrBounty commented 1 year ago

Hello, just use that:

UI:open()                       -- Display the UI
UI:close()                      -- Hide the UI
UI:toggle()                     -- Toggle the UI

From: https://github.com/MrBounty/PZ-UI_API/blob/main/UI%20functions.md