Skip to content

Scripting Tutorial

MichPerry-GG edited this page Mar 19, 2013 · 32 revisions

!!!THIS IS A WORK IN PROGRESS TUTORIAL. NOT READY FOR REVIEW OR CONSUMPTION!!!

This guide will take you through the process of creating a basic script for Torque 2D.

The following guide(s) are recommended before you begin this tutorial:

The following guide(s) are useful to have available while completing this tutorial:

Table of Contents

Chapter 1. Script Definition

Chapter 2. Creating a script

Chapter 3. Executing a script

Chapter 4. Script scope

Chapter 5. Global functions

Chapter 6. Object method

Chapter 7. Callbacks

Chapter 8. Named objects

Chapter 9. Packages

Chapter 10. Conclusion

Chapter 1. Script Definition

What is a script?

Chapter 2. Creating a script

Creating the file.

Chapter 3. Executing a script

Loading the file into the engine.

Chapter 4. Script scope

Local vs Global. Variables vs Objects.

Chapter 5. Global functions

Stand-alone functions.

Chapter 6. Object method

Functions attached to objects.

Chapter 7. Callbacks

Functions called from the engine source.

Chapter 8. Named objects

Uniquely named objects in script.

Chapter 9. Packages

Isolating code to packages.

Chapter 10. Conclusion

Finally...

Clone this wiki locally