summary refs log tree commit diff stats
path: root/src/components/static_image.cpp
blob: 9fa8dca19df099edf5ed59dbb2dfb6b93aa0eeb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#include "static_image.h"

StaticImageComponent::StaticImageComponent(const char* filename) : sprite(Texture(filename))
{
  
}

void StaticImageComponent::render(Game&, Entity& entity, Texture& buffer)
{
  buffer.blit(sprite, sprite.entirety(), {(int) entity.position.first, (int) entity.position.second, entity.size.first, entity.size.second});
}