예제 #1
0
void _Log::load_image(){
	if( image_loaded == false && image_path.length() != 0 ) {
		Sprite.SetImage( VNImageManager.get_image( image_path ) );

		Sprite.SetY( WINDOW_HEIGHT - Sprite.GetSize().y );

		switch( align ){

		case 1:
			Sprite.SetX( 0.f );
			break;
		case 2:
			Sprite.SetX( 100.f );
			break;

		case 3:
			Sprite.SetX( WINDOW_WIDTH/2 - Sprite.GetSize().x /2 );
			break;

		case 4:
			Sprite.SetX( WINDOW_WIDTH - 100.f - Sprite.GetSize().x );
			break;

		case 5:
			Sprite.SetX( WINDOW_WIDTH - Sprite.GetSize().x );
			break;

		}


		image_loaded = true;
	}
}
예제 #2
0
cHero::cHero(sf::Sprite & rHeroSprite)
{
    rHeroSprite.SetSubRect(sf::IntRect(4, 4, 67, 67));
    rHeroSprite.SetCenter(0, 64);
    rHeroSprite.SetX(600);
    rHeroSprite.SetY(762);
    setWidth(64);
    setHeight(64);
}
예제 #3
0
void setXYCheckeur(sf::Sprite &Checkeur, Fenetre Fen, sf::Sprite &Case1, sf::Sprite &Case2, sf::Sprite &Case3)
{
	if(Fen.getLargeur()==1152)
	{
		Checkeur.SetX(Case1.GetPosition().x);
		Checkeur.SetY(Case1.GetPosition().y);
	}
	else if(Fen.getLargeur()==1024)
	{
		Checkeur.SetX(Case2.GetPosition().x);
		Checkeur.SetY(Case2.GetPosition().y);
	}
	else
	{
		Checkeur.SetX(Case3.GetPosition().x);
		Checkeur.SetY(Case3.GetPosition().y);
	}
}
예제 #4
0
void caseResolution(sf::RenderWindow &App, sf::Event &Event, sf::Sprite &Case1, sf::Sprite &Case2, sf::Sprite &Case3, sf::Sprite &Checkeur, int &param)
{
	if ((Event.Type == sf::Event::MouseButtonPressed) && (Event.MouseButton.X > Case1.GetPosition().x) && (Event.MouseButton.X < Case1.GetPosition().x+Case1.GetSize().x) && (Event.MouseButton.Y > Case1.GetPosition().y) && (Event.MouseButton.Y < Case1.GetPosition().y+Case1.GetSize().y))
	{
		Checkeur.SetX(Case1.GetPosition().x);
		Checkeur.SetY(Case1.GetPosition().y);
	}
	else if ((Event.Type == sf::Event::MouseButtonReleased) && (Event.MouseButton.X > Case2.GetPosition().x) && (Event.MouseButton.X < Case2.GetPosition().x+Case2.GetSize().x) && (Event.MouseButton.Y > Case2.GetPosition().y) && (Event.MouseButton.Y < Case2.GetPosition().y+Case2.GetSize().y))
	{
		Checkeur.SetX(Case2.GetPosition().x);
		Checkeur.SetY(Case2.GetPosition().y);
	}
	else if ((Event.Type == sf::Event::MouseButtonReleased) && (Event.MouseButton.X > Case3.GetPosition().x) && (Event.MouseButton.X < Case3.GetPosition().x+Case3.GetSize().x) && (Event.MouseButton.Y > Case3.GetPosition().y) && (Event.MouseButton.Y < Case3.GetPosition().y+Case3.GetSize().y))
	{
		Checkeur.SetX(Case3.GetPosition().x);
		Checkeur.SetY(Case3.GetPosition().y);
	}
	param=1;
}
예제 #5
0
void cMario::reset(sf::Sprite & rThisSprite)
{
    rThisSprite.SetX(200);
    rThisSprite.SetY(200);
    xSpeed = 0;
    xAccel = 0;
    ySpeed = 0;
    yAccel = 0;
    setIsDead(false);
}