Last active
August 29, 2015 13:58
-
-
Save Furkanzmc/9938382 to your computer and use it in GitHub Desktop.
A component definition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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