8 :
Sprite(std::move(texture), 0, 0, 0.0f) {
13 :
Sprite(std::move(texture), pos_x, pos_y, 0.0f) {
18 : texture_(std::move(texture)),
20 static_cast<float>(this->
texture_->width()),
21 static_cast<float>(this->
texture_->height())}),
23 {
static_cast<float>(this->texture_->width()) / 2,
24 static_cast<float>(this->texture_->height()) /2}),
31game::core::Sprite::Sprite(std::shared_ptr<game::core::Texture2D> texture,
int pos_x,
int pos_y, Vector2 rotation_origin,
float rotation, Rectangle frame)
32 : texture_(std::move(texture)),
34 rotation_origin(rotation_origin),
42 TraceLog(LOG_INFO,
"game::core::Sprite destructor called");
46 return {
static_cast<float>(this->pos_x),
static_cast<float>(this->pos_y)};
50 return this->texture_;
54 this->texture_ = texture;
56 this->frame_ = {0.0, 0.0,
57 static_cast<float>(this->texture_->width()),
58 static_cast<float>(this->texture_->height())};
60 this->rotation_origin = {
static_cast<float>(this->texture_->width()) / 2,
static_cast<float>(this->texture_->height()) /2};
64 return this->texture_->
texture();
The Sprite class specifies position and degree of rotation on the screen for an associated VRAM textu...
std::shared_ptr< game::core::Texture2D > texture_
The sprites Texture2D.
const ::Texture2D & texture() const
const std::shared_ptr< game::core::Texture2D > & texture_object() const
const Rectangle & frame() const
const ::Texture2D & texture() const