Game Development Reference
In-Depth Information
// In form.cs
private void InitializeTextures()
{
// Init DevIl
Il.ilInit();
Ilu.iluInit();
Ilut.ilutInit();
Ilut.ilutRenderer(Ilut.ILUT_OPENGL);
// Textures are loaded here.
_textureManager.LoadTexture("title_font", "title_font.tga");
_textureManager.LoadTexture("general_font", "general_font.tga");
}
Engine.Font _generalFont;
Engine.Font _titleFont;
private void InitializeFonts()
{
// Fonts are loaded here.
_titleFont ¼ new Engine.Font(_textureManager.Get("title_font"),
FontParser.Parse("title_font.fnt"));
_generalFont ¼ new Engine.Font(_textureManager.Get("general_font"),
FontParser.Parse("general_font.fnt"));
}
This new general font can now be passed through to the StartMenuState in
the constructor and will be used to construct the vertical menu. The Input class
is also passed along at this point and therefore the using Engine.Input
statement must be added to the other using statements at the top of the Start-
MenuState.cs file.
Engine.Font _generalFont;
Input _input;
VerticalMenu _menu;
public StartMenuState(Engine.Font titleFont, Engine.Font generalFont,
Input input)
{
_input ¼ input;
_generalFont ¼ generalFont;
InitializeMenu();
Search WWH ::




Custom Search