blob: 236c83c444d7459e0effaa07a9c28aea148a8ec6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#include "particle.hpp"
#include <YAGE/Math/vector2d.hpp>
#include <YAGE/resourcemanager.hpp>
Particle::Particle() : particle_body_(yage::Vector2D(200.f/70.f, 600.f/70.f))
{}
Particle::~Particle()
{}
void Particle::setTexture(const std::string &texture_path)
{
texture_=yage::ResourceManager::getTexture(texture_path);
}
void Particle::renderSprite(yage::SpriteBatch &sprite_batch)
{
sprite_batch.draw(glm::vec4(70*particle_body_.xPosition(), 70*particle_body_.yPosition(), 50, 50), glm::vec4(0.f, 0.f, 1.f, 1.f), texture_.id, yage::Color(255, 255, 255, 255), 0.f);
particle_body_.update();
}
|