danmaku/spritenode.cpp

21 lines
412 B
C++
Raw Normal View History

2021-01-09 11:41:58 +01:00
#include "spritenode.h"
SpriteNode::SpriteNode(const sf::Texture& texture)
{
sprite.setTexture(texture);
}
SpriteNode::~SpriteNode()
{}
SpriteNode::SpriteNode(const sf::Texture& texture, const sf::IntRect& rect)
{
sprite.setTexture(texture);
sprite.setTextureRect(rect);
}
void SpriteNode::drawCurrent(sf::RenderTarget& target, sf::RenderStates states) const
{
target.draw(sprite, states);
}