Changed AnimationComponent to use GuiComponent instead of ImageComponent.

Possible now that the opacity logic has been moved to GuiComponent.
This commit is contained in:
Aloshi 2013-07-02 18:13:55 -05:00
parent 29b1ac1b13
commit df78b5352d
2 changed files with 4 additions and 5 deletions

View file

@ -76,7 +76,7 @@ void AnimationComponent::update(int deltaTime)
}
}
void AnimationComponent::addChild(ImageComponent* gui)
void AnimationComponent::addChild(GuiComponent* gui)
{
mChildren.push_back(gui);
}
@ -86,7 +86,7 @@ void AnimationComponent::moveChildren(int offsetx, int offsety)
Vector2i move(offsetx, offsety);
for(unsigned int i = 0; i < mChildren.size(); i++)
{
ImageComponent* comp = mChildren.at(i);
GuiComponent* comp = mChildren.at(i);
comp->setOffset(comp->getOffset() + move);
}
}

View file

@ -2,7 +2,6 @@
#define _ANIMATIONCOMPONENT_H_
#include "../GuiComponent.h"
#include "ImageComponent.h"
#include <vector>
#define ANIMATION_TICK_SPEED 16
@ -18,12 +17,12 @@ public:
void update(int deltaTime);
void addChild(ImageComponent* gui);
void addChild(GuiComponent* gui);
private:
unsigned char mOpacity;
std::vector<ImageComponent*> mChildren;
std::vector<GuiComponent*> mChildren;
void moveChildren(int offsetx, int offsety);
void setChildrenOpacity(unsigned char opacity);