Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A component definition
#ifndef SPRITECOMPONENT_H
#define SPRITECOMPONENT_H
#include "BaseComponent.h"
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Texture.hpp>
class SpriteComponent : public zmc::BaseComponent, public sf::Sprite
{
public:
SpriteComponent(int componentType)
: BaseComponent(componentType)
{
if (texture.loadFromFile("/home/furkan/Pictures/Platformer Deluxe/Items/bomb.png"))
setTexture(texture);
}
sf::Texture texture;
};
#endif // SPRITECOMPONENT_H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment