Dziuala 3 strzlowiec
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
Actor::Actor(int x, int y, std::string path) {
|
||||
loadTexture(path);
|
||||
Actor::Actor(int x, int y, const sf::Texture& texture) {
|
||||
actorSprite.setTexture(texture);
|
||||
position.x = x;
|
||||
position.y = y;
|
||||
actorSprite.setOrigin(actorSprite.getLocalBounds().width / 2, actorSprite.getLocalBounds().height / 2); // wycentrowanie sprite
|
||||
@@ -19,6 +19,9 @@ void Actor::loadTexture(std::string path) {
|
||||
}
|
||||
|
||||
sf::Sprite &Actor::getSprite() {
|
||||
if (!actorSprite.getTexture()) {
|
||||
std::cerr << "actorSprite has no texture set!" << std::endl;
|
||||
}
|
||||
return actorSprite;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user