@Override
    public void buttonPressed(ClickableComponent button) {
    
    	if (button instanceof LevelButton) {
    
    		LevelButton lb = (LevelButton) button;
    		TitleMenu.level = levels.get(lb.getId());
    
    		if (activeButton != null && activeButton != lb) {
    			activeButton.setActive(false);
    		}
    
    		activeButton = lb;
    	}
    	
    	else if (button == previousPageButton && hasPreviousPage()) {
    	    goToPage(currentPage - 1);
    	}
    	
        else if (button == nextPageButton && hasNextPage()) {
            goToPage(currentPage + 1);
        }
    }