Creating Layouts

You can find the Javascript code and images which define the application look and feel in the following path:-

/sdcard/NxtRemote

A file called ‘Scripts.txt’ lists all the scripts that make up the NxtRemote program, the contents of this file look like this:-

<script language=’JavaScript’ src=’Shared.js’></script>
<script language=’JavaScript’ src=’JoyPad.js’></script>
<script language=’JavaScript’ src=’MultiPad.js’></script>
<script language=’JavaScript’ src=’TiltPad.js’></script>
<script language=’JavaScript’ src=’Sensors.js’></script>
<script language=’JavaScript’ src=’Main.js’></script>

The script file ‘Main.js’ is loaded when the application starts and defines the main functionality of the program.  There is a script file corresponding to each of the provided layouts and copying one of these is a good place to start when making your own layout.

These scripts are well commented and (hopefully) self explanitory to someone who is familiar with Javascript.  You can modify the scripts using Notepad or your favourite text editor either directly on the phone or by copying it to your PC editing it and copying it back again.  You will need to restart the app in order to pick up any changes that you have made to the script. 

Note: If you delete any of the installed files found in /sdcard/NxtRemote they will be automatically replaced the next time you start the application, so if it all goes badly wrong, you can always get back to a working application!

Happy scripting!

[More documentation coming soon…]