Inb4 "BraXi's flirt game for beginners"Game name is still hidden
ish
I know what it isGame name is still hidden

UIItem item = newUIElement( UI_IMAGE ); item.setRect( 0,0,800,600 ); item.setImage( MaterialMgr.loadMaterial( "ui_main_bg" ) ); UIItem item2 = newUIElement( UI_TEXT ); item2.setRect( 400,300,0,0 ); item2.align = ALIGN_CENTER; item2.font = FONT_DEFAULT; item2.setColor( 0.5f, 0.7f, 1.0f, 1.0f ); item2.setText( "This is simple UI_TEXT item %i!", 123 ); [......] renderMenu( "menu_test" );
void UI_Main::init()
{
rotatey = 0.0f;
gfx[0] = MaterialMgr.loadMaterial( "ui_main_bg" );
gfx[1] = MaterialMgr.loadMaterial( "ui_main_darken" );
gfx[2] = MaterialMgr.loadMaterial( "ui_button_red" );
gfx[3] = MaterialMgr.loadMaterial( "ui_main_clouds" );//animated cloud
gfx[4] = MaterialMgr.loadMaterial( "ui_main_grass" );
gfx[5] = MaterialMgr.loadMaterial( "ui_main_logo" );
}
void UI_Main::button( int group, int id, int y, char *text )
{
UI.drawImage( 400.0f, (float)y, 200, 40, ALIGN_CENTER, gfx[2] );
UI.drawText( FONT_DEFAULT, 400-8, y+28, ALIGN_CENTER, text );
Vector2i mPos = Com.getMousePos();
if( UI.isMouseOver( 300, y, 200, 40 ) )
{
if( id == 4 )
{
glColor3f( 0.9f, 0.4f, 0.4f );
UI.drawText( FONT_DEFAULT, mPos.x, mPos.y+45, ALIGN_CENTER, "Do you really want to leave? <img src='http://www.afterlifegaming.net/main/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />" );
glColor3f( 1.0f, 1.0f, 1.0f );
}
if( Com.isMouseButtonPressed( BUTTON_LEFT ) )
{
switch( id )
{
case 4:
exit( 1 );
break;
}
}
}
}
void UI_Main::render()
{
glColor4f( 0.5f, 0.5f, 0.5f, 1.0 );
UI.drawImage( 0.0f, 0.0f, 800, 600, gfx[0] );
UI.drawImage( 0.0f, 0.0f, 800, 600, gfx[1] );
if( fadein )
{
alpha += 0.002f;
if( alpha >= 0.86f )
fadein = false;
}
else
{
alpha -= 0.002f;
if( alpha <= 0.5f )
fadein = true;
}
glColor4f( 0.8f, 0.8f, 0.8f, alpha );
UI.drawImage( 0.0f, 0.0f, 800, 600, gfx[3] );
glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
UI.drawImage( 0.0f, 100.0f, 800, 500, ALIGN_LEFT, gfx[4] );
UI.drawImage( 400.0f, 100.0f, 460, 100, ALIGN_CENTER, gfx[5] );
GLuint offset = 300;
button( 0, 0, offset, "START NEW GAME" );
offset += 44;
button( 0, 1, offset, "SELECT MISSION" );
offset += 64;
button( 0, 2, offset, "OPTIONS" );
offset += 44;
button( 0, 3, offset, "CREDITS" );
offset += 64;
button( 0, 4, offset, "LEAVE GAME" );
UI.drawText( FONT_DEFAULT, 790, 595, ALIGN_RIGHT, "BXEngine (c) BraXi 2012 [%s]", __DATE__ );
}
0 members, 0 guests, 0 anonymous users