//
//  TimedLabel.cpp
//  GlobalGameJam15
//
//  Created by Cesar Parent on 24/01/2015.
//  Copyright (c) 2015 Cesar Parent. All rights reserved.
//

#include "TimedLabel.h"

TimedLabel::TimedLabel(std::string text, int duration) : LabelNode(text, "assets/uis/font")
{
	_duration = duration;
	_frames = 0;
}

TimedLabel::~TimedLabel()
{
	
}

void TimedLabel::update(int timeInterval)
{
	LabelNode::update(timeInterval);
	if(_frames >= _duration)
	{
		removeFromParent();
	}
	_frames++;
	setFontSize(_fontSize + 2);
}

void TimedLabel::didExitParent()
{
	delete this;
}