to Main Page

Tutorial

Set the stage's size, color and framerate

To modify the size and background color of the stage, simply change the following line of code in the main file:

[SWF(width="800", height="600", backgroundColor="#333333")]

NOTE: if you change the dimensions you must also update the STAGE_WIDTH and STAGE_HEIGHT constants in the org.MARS.util.IOUtil class.

To set the framerate, you can use the stage.frameRate property in the main file, however it is preferable if you set the FRAMERATE constant in the org.MARS.util.IOUtil class and put the following line of code in the main file, since MARS uses the constant for time calculations:

//set the framerate
stage.frameRate = IOUtil.FRAMERATE;