Create a new component
Step by step to create a component
namespace ECS {
namespace components {
class ParallaxComponent {
public:
ParallaxComponent(float scrollSpeed, float backgroundWidth): _scrollSpeed(scrollSpeed), _backgroundWidth(backgroundWidth) {}
float getScrollSpeed() const { return _scrollSpeed; }
float getBackgroundWidth() const { return _backgroundWidth; }
void setScrollSpeed(const float &scrollSpeed);
void setBackgroundWidth(const float &backgroundWidth);
private:
float _scrollSpeed;
float _backgroundWidth;
};
}
}Last updated