The game background will be just one image of some fields. It needs to be assigned to the background layer. That is all.
1. Add the method
CreateBackgroundScreen
to thegame
class.Method CreateBackgroundScreen:Int()
2. Set the default layer to
layerBackground
.eng.SetDefaultLayer(layerBackground)
3. Create a local object that calls
CreateImage
. It will be displayed in the center of the canvas. After that, close the method.Local obj:= eng.CreateImage("background.png",cw/2,ch/2) Return 0 End
With this new method, you have loaded the background image. For other platforms, you could also create some buttons to switch back to the title screen, but we will handle this differently.