Saving, loading, fonts and buttons.

Monkey Forums/Monkey Beginners/Saving, loading, fonts and buttons.

ewancordiner(Posted 2017) [#1]
Hi, getting through my clicker project and was just wondering if anyone knew how to implement save/ load states? Also planning on having buttons going to different menus which I have got and was wondering if this was easily implementable? thank you. The regular font is also a bit of an eyesore and as a result of this I was wondering if anyone had any tips on a way to get a better font as I'm not sure how this would work?


Gerry Quinn(Posted 2017) [#2]
If you want to target all platforms including HTML5, you'll have to find a way to squeeze all your data into a string, which you can save and load using SaveString and LoadString. For standard files on the other main targets, look up the file system functions in the BRL modules.

Buttons going to different menus is of course implementable, but how you do it is up to you. I generally have a TestButtons method, called on every update, and a hit on any button can result in a particular menu screen, a reset of the game, or anything else you like. The simplest way to handle menus is to have a state variable in a single window, but it will be more elegant to have each menu in its own window that overlays or replaces the game screen.

For fonts I use AngelFont (it comes in the bananas, with examples of use). Search the site for help on how to prepare your own bitmap fonts. But there are a couple of alternatives you can use if you prefer.