1
Window / Re: Drawing sprite while passing ByRef RenderWindow
« on: June 13, 2014, 02:23:32 pm »
The Bullet contructor is :
it is initialized and stored well, on debug i don't receive error on texture or on sprite it seems that the procedure draws it correctly but i don't see it
P.S.
@Jesper Juhl @select_this I am a C# programmer
Bullet::Bullet(){
this->MoveVelocity = 5;
this->posX = 0;
this->posY = 0;
this->dead = true;
if (this->bulletTexture.loadFromFile("img\\bullet\\bullet.png"))
{
this->bulletTexture.setSmooth(true);
this->bulletTexture.setRepeated(true);
this->bulletSprite.setTexture(this->bulletTexture);
//this->bulletSprite.setScale(0.7F, 0.7F);
}
}
Bullet::Bullet(int x, int y){
this->MoveVelocity = 5;
this->posX = x;
this->posY = y;
this->dead = false;
if (this->bulletTexture.loadFromFile("img\\bullet\\bullet.png"))
{
this->bulletTexture.setSmooth(true);
this->bulletTexture.setRepeated(true);
this->bulletSprite.setTexture(this->bulletTexture);
this->bulletSprite.setColor(sf::Color::Red);
//this->bulletSprite.setScale(0.7F, 0.7F);
}
};
//BULLET piece of HEADER:
#ifndef Bullet_H
#define Bullet_H
class Bullet{
public:
Bullet();
Bullet(int x, int y);
sf::Sprite retBullet();
void Explode();
void SetPos(int x, int y);
bool isDead();
protected:
private:
sf::Texture bulletTexture;
sf::Sprite bulletSprite;
int posX;
int posY;
int MoveVelocity;
bool dead;
};
#endif
this->MoveVelocity = 5;
this->posX = 0;
this->posY = 0;
this->dead = true;
if (this->bulletTexture.loadFromFile("img\\bullet\\bullet.png"))
{
this->bulletTexture.setSmooth(true);
this->bulletTexture.setRepeated(true);
this->bulletSprite.setTexture(this->bulletTexture);
//this->bulletSprite.setScale(0.7F, 0.7F);
}
}
Bullet::Bullet(int x, int y){
this->MoveVelocity = 5;
this->posX = x;
this->posY = y;
this->dead = false;
if (this->bulletTexture.loadFromFile("img\\bullet\\bullet.png"))
{
this->bulletTexture.setSmooth(true);
this->bulletTexture.setRepeated(true);
this->bulletSprite.setTexture(this->bulletTexture);
this->bulletSprite.setColor(sf::Color::Red);
//this->bulletSprite.setScale(0.7F, 0.7F);
}
};
//BULLET piece of HEADER:
#ifndef Bullet_H
#define Bullet_H
class Bullet{
public:
Bullet();
Bullet(int x, int y);
sf::Sprite retBullet();
void Explode();
void SetPos(int x, int y);
bool isDead();
protected:
private:
sf::Texture bulletTexture;
sf::Sprite bulletSprite;
int posX;
int posY;
int MoveVelocity;
bool dead;
};
#endif
it is initialized and stored well, on debug i don't receive error on texture or on sprite it seems that the procedure draws it correctly but i don't see it
P.S.
@Jesper Juhl @select_this I am a C# programmer