How To: Use Hardware Buttons
Almost all devices that can play mediascapes have buttons. You can use these buttons when building your mediascape so then when a user actually goes out and plays it then they can control stuff in the mediascape. For example if you want the user to be able to mark a place then you can give them a button for that and they can press it whenever they want to mark that space. Let's begin by starting the mscape maker and creating a new mediascape. The now if you look in the Tools section in the left hand panel you will see an entry called Buttons. This is the Buttons object that I will now describe how to use.
If you click on it then you will see it's properties in the bottom left of your maker window, we will come back to these at the end of the how to.
You will also see five new events in the script panel at the bottom of the maker window. This is the important bit of the buttons object. There are five events OnUp, OnDown, OnLeft, OnRight and OnCenter, these correspond to the four directions and the middle of your device's joystick or directional pad. These are the buttons that we can control and what the user can press to trigger things in the mediascape.
Before we can go any further we need something for the buttons to do. For this we are going to import some images, please follow the steps in How To Import Media to add a few image files, try to make sure they are not much bigger than the resolution of your mobile device, otherwise they will be quite slow to load. Now we can use buttons to show images.
Click on the Buttons object and look at the script panel near the bottom of the maker that we looked at earlier. Lets make an image show when the user press up on their device. To do this we drag one of the image objects that you imported earlier into the event window and drop it. We then type a "." and a list of things that we can do with the image will show up, we will select show. The event window should now look a bit like this, only with your own image name.
Now lets hide the same image when the user pushes down. To do this we click on the OnDown tab in the events windows and drag the same image object into that event. Then we type a "." and select hide.
Before we finish there is one more thing to do, if you remember there are properties on the button object as well. These are labels to help the user know what each button does. They will show up on the player under the Button Help entry in the player's main menu. You can write whatever you want into these but remember that the player's screen is only quite small and not much text will fit.
To test this lets run it in the tester. To do this click on the tester button on the tool bar at the top of the maker.
In the tester you can pretend to press buttons by using the little buttons on the right of the tester. Try pressing the up and down arrows.
Congratulations you have now built a mediascape that uses buttons! Other things that people often use buttons for is playing and pausing a piece of audio, showing the map displayer, or showing some kind of help page for the mediascape the user is currently in. These are all shown in the example mediascape that I have uploaded here: Download example from here. But I'm sure you can think of better uses for buttons! Learn how to use buttons to implement the controls Pause, Resume and Repeat the last instruction.