Dlaczego mogę dać tylko 2 sprite a potem nie?
Pracuje se w C::B i wszystko ok robię sobie grę do szkoły mam i nagle dodaje 3 sprite i niemożna !!!
#include <SFML/Graphics.hpp>
#include <windows.h>
#inlcude <iostream>
int main()
{
sf::RenderWindow Win( sf::VideoMode( 640, 480, 32 ), "GalaXy" );
Sleep(2500);
sf::Texture tekstura;
tekstura.loadFromFile( "Statek-X.png" );
sf::Sprite obrazek;
obrazek.setTexture( tekstura );
sf::Texture tlo;
tlo.loadFromFile( "Space-X.png" );
sf::Sprite tlo2;
tlo2.setTexture( tlo );
sf::Texture Blok;
Blok.loadFromFile( "Bloczek.png" );
sf::Sprite Blok2;
Blok2.setTexture( Blok );
obrazek.setPosition( 220, 350 );
while( Win.isOpen() )
{
sf::Event zdarzenie;
while( Win.pollEvent( zdarzenie ) )
{
if( zdarzenie.type == sf::Event::Closed )
Win.close();
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::Escape )
Win.close();
if( zdarzenie.type == sf::Event::MouseButtonPressed && zdarzenie.mouseButton.button == sf::Mouse::Middle )
Win.close();
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::D )
obrazek.move( 30,0 );
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::A )
obrazek.move( -30,0 );
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::S )
obrazek.move( 0,30 );
if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::W )
obrazek.move( 0,-30 );
}
obrazek.setScale( 0.3, 0.3 );
Win.draw( obrazek, Blok, tlo2 );
Win.display();
}
return 0;
}
takie info otrzymuje! ( zamiast informacji napisałem nazwa ponieważ nie chce by ktoś widział moje imię i nazwisko)
C:\Users\Nazwa\Documents\Galaxy\main.cpp||In function 'int main()':|
C:\Users\Nazwa\Documents\Galaxy\main.cpp|62|error: no matching function for call to 'sf::RenderWindow::draw(sf::Sprite&, sf::Texture&, sf::Sprite&)'|
C:\Users\Nazwa\Documents\Galaxy\main.cpp|62|note: candidates are:|
..\..\Desktop\SFML-2.3.2\include\SFML\Graphics\RenderTarget.hpp|236|note: void sf::RenderTarget::draw(const sf::Drawable&, const sf::RenderStates&)|
..\..\Desktop\SFML-2.3.2\include\SFML\Graphics\RenderTarget.hpp|236|note: candidate expects 2 arguments, 3 provided|
..\..\Desktop\SFML-2.3.2\include\SFML\Graphics\RenderTarget.hpp|247|note: void sf::RenderTarget::draw(const sf::Vertex*, std::size_t, sf::PrimitiveType, const sf::RenderStates&)|
..\..\Desktop\SFML-2.3.2\include\SFML\Graphics\RenderTarget.hpp|247|note: no known conversion for argument 1 from 'sf::Sprite' to 'const sf::Vertex*'|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 1 seconds) ===|