Game Development Reference
In-Depth Information
The CreateInitBillBoard() function creates and returns a new BillBoard object according to the
input Texture resource, object position, and object scale values. (See Listing 9-37.)
Listing 9-37. Creating a BillBoard Object
BillBoard CreateInitBillBoard(Context iContext,int TextureResourceID,Vector3 Position,Vector3 Scale)
{
BillBoard NewBillBoard = null;
Texture BillBoardTexture = new Texture(iContext, TextureResourceID);
//Create Shader
Shader Shader = new Shader(iContext, R.raw.vsonelight, R.raw.fsonelight); // ok
MeshEx Mesh = new MeshEx(8,0,3,5,Cube.CubeData, Cube.CubeDrawOrder);
// Create Material for this object
Material Material1 = new Material();
// Create Texture for BillBoard
Texture[] Tex = new Texture[1];
Tex[0] = BillBoardTexture;
// Create new BillBoard
NewBillBoard = new BillBoard(iContext, null, Mesh, Tex, Material1, Shader );
// Set Initial Position and Orientation
NewBillBoard.m_Orientation.SetPosition(Position);
NewBillBoard.m_Orientation.SetScale(Scale);
NewBillBoard.GetObjectPhysics().SetGravity(false);
return NewBillBoard;
}
The CreateHighScoreTable() function creates the high score table that is assigned to the
m_HighScoreTable variable. (See Listing 9-38.)
Listing 9-38. Creating the High Score Table
void CreateHighScoreTable(Context iContext)
{
int TextureResourceID = R.drawable.background;
Vector3 Position = new Vector3(0.5f, 1, 4);
Vector3 Scale = new Vector3(4.5f,5,1);
BillBoard HighScoreTableImage = CreateInitBillBoard(iContext,TextureResourceID,Position,Scale);
m_HighScoreTable = new HighScoreTable(iContext,m_CharacterSet,HighScoreTableImage);
}
The CreateHighScoreEntryMenu() function creates the high score entry menu. (See Listing 9-39.)
 
Search WWH ::




Custom Search