I think I've been adding commands faster than I've been explaining how the game engine works.
The First rule is that you must execute an Orientation 1 or 2 to fix the screen in portrait or landscape before turning the game engine on.Orientation 2
GameEngine On, 800, 480, "GameEngine/Loading.png"
That's it, the game engine is on. The 800, 400 is the width and height you want the screen to be. This works like the SetScale command in the graphics mode. These are optional parameters and if omitted will default to the actual size of your screen. Then the "GameEngine/Loading.png" is an optional splash screen that will be displayed until a GenSplashScreen Off is executed.
Next you must set up the graphics that will be shared by all your sprites. (Before you ask it's done this way for maximum speed, flexibility and compatibility with the on-board GPU).atlas = GenTextureAtlas(1024, 1024)
It's fairly safe to assume that the GPU in your Android device has at least 1mb of on-chip ram. A texture atlas is a way of dividing up that memory for use in your game. You might not need so much and could define a 512 x 512 block of memory. But the size you choose must be 512 x 512 or 1024 x 1024 or any combination of the two.
Atlas' are made up of textures. A texture (in this case) is a graphics block like a bitmap but divided up into tiles.texture = GenTexture("GameEngine/textureScene96x96.png", 96, 96)
This is an actual texture from my game Mintoris Space. As you can see it is made of a group of 96x96 graphic tiles. A single texture atlas may contain many textures each with differing size tiles.
But, to keep things simple, we create a single texture and put it into our texture atlas.GenMapToAtlas atlas, texture, 0, 0
Now we load the texture atlas onto the GPUGenLoadAtlas atlas
The graphics are now set up ready to be used by sprites.
So, we finally create a sprite and use our set of 96x96 images as it's tile set.sprite = GenSprite(texture)
You can then set which tile to display.GenSetSpriteTile sprite, 5
You can then use any of sprite commands you want.
Textures can also be created from normal bitmaps.bitmap = CreateBitmap(960, 480)
draw on the bitmap…texture = GenTexture(bitmap, 96, 96)
The problem atm is that you have to have the graphics mode on to draw on a bitmap. I plan to fix it so you can create and draw on bitmaps anytime. That will allow run time created graphic elements.Ask any questions now. You can bet all of this will make it into the reference manual.