For example, let's look at loading the bitmap font and loading the sprite atlas:
1. Inside the
OnCreate
method of the game class, change the canvas size to the resolution of the iPhone 4. This way, we have more space for the game. It will be automatically scaled down on older devices.Method OnCreate:Int() SetUpdateRate(60) eng = New engine eng.SetCanvasSize(640,960)
2. To make our life easier by typing less, we store the dimensions of the canvas inside
cw
andch
.cw = eng.canvasWidth ch = eng.canvasHeight
3. Now, load the sprite sheet and the bitmap font.
atlas = LoadImage("bo_tiles.png") font1 = eng.LoadFont("bo_font") Return 0 End