mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 06:05:38 +00:00
Changed AnimationComponent to use GuiComponent instead of ImageComponent.
Possible now that the opacity logic has been moved to GuiComponent.
This commit is contained in:
parent
29b1ac1b13
commit
df78b5352d
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue