Game/Source/SceneTitle.cpp
// Called before the first frame / when activated
Called before the first frame / when activated
Called before the first frame / when activated
bool SceneTitle::Load()
{
	LOG("Loading Title Screen");
	 Load map
	map = (Map*)entityManager->CreateEntity(EntityType::MAP);
	map->Load("scene_title.tmx");
	 Load buttons
	GUITexture = tex->Load("Assets/Textures/GUI/gui_spritesheet.png");
	buttonPlay = new GUIButton(1, { 56, 128, 100, 24 }, "PLAY", audioManager, fonts);
	buttonPlay->SetObserver(this);
	buttonPlay->SetTexture(GUITexture);
	buttonContinue = new GUIButton(2, { 166, 128, 100, 24 }, "CONTINUE", audioManager, fonts);
	buttonContinue->SetObserver(this);
	buttonContinue->SetTexture(GUITexture);
	buttonContinue->state = GUIControlState::DISABLED;
	buttonSettings = new GUIButton(3, { 276, 128, 100, 24 }, "SETTINGS", audioManager, fonts);
	buttonSettings->SetObserver(this);
	buttonSettings->SetTexture(GUITexture);
	buttonCredits = new GUIButton(4, { 111, 176, 100, 24 }, "CREDITS", audioManager, fonts);
	buttonCredits->SetObserver(this);
	buttonCredits->SetTexture(GUITexture);
	buttonExit = new GUIButton(5, { 221, 176, 100, 24 }, "EXIT", audioManager, fonts);
	buttonExit->SetObserver(this);
	buttonExit->SetTexture(GUITexture);
	 Load music
	audioManager->PlayMusic("Assets/Audio/Music/title_screen_music.ogg");
	 Move camera
	render->camera.x = render->camera.y = 0;
	return false;
}
bool SceneTitle :: Load ( ) { LOG ( " " ) ; map = ( Map * ) entityManager -> CreateEntity ( EntityType :: MAP ) ; map -> Load ( " " ) ; GUITexture = tex -> Load ( " " ) ; buttonPlay = new GUIButton ( 1 , { 56 , 128 , 100 , 24 } , " " , audioManager , fonts ) ; buttonPlay -> SetObserver ( this ) ; buttonPlay -> SetTexture ( GUITexture ) ; buttonContinue = new GUIButton ( 2 , { 166 , 128 , 100 , 24 } , " " , audioManager , fonts ) ; buttonContinue -> SetObserver ( this ) ; buttonContinue -> SetTexture ( GUITexture ) ; buttonContinue -> state = GUIControlState :: DISABLED ; buttonSettings = new GUIButton ( 3 , { 276 , 128 , 100 , 24 } , " " , audioManager , fonts ) ; buttonSettings -> SetObserver ( this ) ; buttonSettings -> SetTexture ( GUITexture ) ; buttonCredits = new GUIButton ( 4 , { 111 , 176 , 100 , 24 } , " " , audioManager , fonts ) ; buttonCredits -> SetObserver ( this ) ; buttonCredits -> SetTexture ( GUITexture ) ; buttonExit = new GUIButton ( 5 , { 221 , 176 , 100 , 24 } , " " , audioManager , fonts ) ; buttonExit -> SetObserver ( this ) ; buttonExit -> SetTexture ( GUITexture ) ; audioManager -> PlayMusic ( " " ) ; render -> camera . x = render -> camera . y = 0 ; return false ; }
Called before the first frame / when activated
Called before the first frame / when activated
// // Load map // // // Load buttons // // // Load music // // // Move camera //