Skip to content

Instantly share code, notes, and snippets.

@Furkanzmc
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Furkanzmc/9938382 to your computer and use it in GitHub Desktop.
Save Furkanzmc/9938382 to your computer and use it in GitHub Desktop.
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