The following files have been attached to this tutorial:
This tutorial hasn't been translated.
This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.
This tutorial will show you how to create a simple menu that has basic save and load functions that can be named by typing in the keyboard. This system was designed for desktop use but could be adapted for mobile publishing.
Download the capx: https://static3.scirra.net/uploads/articles/5016/mLoadSaveFlashyMenu.capx
This makes use of SpriteFont+ and LiteTween for the menu, and Pause and charcode plugins for this example, it may be possible for this to be done without them but for now, this is how we roll: https://dl.dropbox.com/u/5779181/C2Repo/Zip/plugins/rex_pause.7z
It also features code for the flashy menu.
Here are the globals needed for everything to function correctly:
The first few globals control where in the menu we are and the last bunch control the name of the globals.
Here is the initial set-up for hiding the menu and setting up the tweens and flashes:
This picks the menu item and sets the flashing:
And picking for the save menu:
Here's how we extract the saved game names from localstore, should they be set (by a previous save or player:)
Some more flashing:
Here's checks for each slot if they're currently in the middle of having their names set:
This appends the cursor during save:
Here's how we add whatever is typed to the save game name:
Repeat for a second time:
And a third:
You can continue that for all six slots.
This wraps the selected menu item around when you press up on the top one or down on the bottom one. I used 1 and 2 instead of 0 and 1 as I had already a menu item above save and a few below load from the game I ported this example from, but feel free to adjust the values as needed.
Repeat the selecting method for the load menu:
And our saved load names:
This loads from whichever slot we have selected:
And hides the menu when loaded:
And that's it. Sorry about the plugins and the somewhat un-optimized approach, I'm sure it's possible to be done in less events if compacted together, but this is a fairly clear and easy-to-read way of building a menu like this.
Do you have an updated link for charCode.zip?