Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AlexxanderX

Pages: 1 ... 7 8 [9]
121
Graphics / Re: Texture to a rectangle
« on: October 07, 2012, 08:02:49 pm »
Thanks. After reading some tutorials and start understand what mean pointer I succefully made it.
Here is the code, if need some modifications please tell:
sf::Texture texture;
        if (!texture.loadFromFile("resources/backgroundimage.png"))
     return -1;

     const sf::Texture *pTexture = &texture;

    // Jucatorul din stanga
    sf::RectangleShape leftPaddle;
    leftPaddle.setSize(paddleSize - sf::Vector2f(3, 3));
    leftPaddle.setOutlineThickness(3);
    leftPaddle.setOutlineColor(sf::Color::Black);
    leftPaddle.setFillColor(sf::Color(100, 100, 200));
    leftPaddle.setTexture(pTexture);
    leftPaddle.setOrigin(paddleSize / 2.f);

122
Graphics / Re: Texture to a rectangle
« on: October 07, 2012, 01:16:44 pm »
Yes, I read it, but I have problems in understood it and putting it in my code.

123
Graphics / Re: Texture to a rectangle
« on: October 07, 2012, 12:56:00 pm »
I can't understand how to put it correctly.  :-\

124
Graphics / Texture to a rectangle
« on: October 07, 2012, 12:25:27 pm »
I have soprems setting to a  renctangle the texture:

     sf::Texture texture;
        if (!texture.loadFromFile("resources/backgroundimage.png"))
     return -1;

    // Jucatorul din stanga
    sf::RectangleShape leftPaddle;
    leftPaddle.setSize(paddleSize - sf::Vector2f(3, 3));
    leftPaddle.setOutlineThickness(3);
    leftPaddle.setTexture(texture);
    leftPaddle.setOrigin(paddleSize / 2.f);

And give me these erors:
F:\CPlusPlus\Work\AnticPong\anticpong.cpp||In function 'int main()':|
F:\CPlusPlus\Work\AnticPong\anticpong.cpp|50|error: no matching function for call to 'sf::RectangleShape::setTexture(sf::Texture&)'|
F:\CPlusPlus\Plugins\SFML-2.0\include\SFML\Graphics\Shape.hpp|74|note: candidates are: void sf::Shape::setTexture(const sf::Texture*, bool)|
||=== Build finished: 1 errors, 0 warnings ===|
 

125
General discussions / Re: SFML 2.0 Tutorials?
« on: October 06, 2012, 03:42:29 pm »
So any tutorials for SFML 2? I don't know programming in version 1.6.

126
General / Re: Can't figure out - SFML 2.0 - MinGW( Code::Blocks)
« on: October 06, 2012, 11:02:56 am »
I know that but the video is not really updated and helped me a lot( why? because I don't understand very good english).

Exist tutorials who start from 0 knowlege and to learn the base of programming with SFML? I know exists category tutorials but I don't understand very good all what is in a tutorial from there.

127
General / Re: Can't figure out - SFML 2.0 - MinGW( Code::Blocks)
« on: October 06, 2012, 10:03:17 am »
I followed this tutorial: and after this http://sfmlcoder.wordpress.com/2011/05/18/creating-a-first-sfml-project/ and is worked with the exemple code from tutorial http://www.sfml-dev.org/tutorials/2.0/start-cb.php. Thanks for trying to help Laurent. In finally I can start programming.  ;D

128
General / Can't figure out - SFML 2.0 - MinGW( Code::Blocks)
« on: October 06, 2012, 07:57:09 am »
Hello guys. For some hours I try to set SFML 2.0 for Code::Blocks( MinGW) and can't. Here is what I tried:
1.I used the files from download directly and setted the Code::Blocks fom tutorial and used the example from tutorial to test if work.
Erros:
ld.exe||cannot find -lsfml-graphics|
||=== Build finished: 1 errors, 0 warnings ===|

2.Tried with the tutorial to recompile it using CMake. I recompiled without errors and setted in the Code::Blocks the new dir. Same example used.
Errors:
D:\C++ Work\Test\Untitled3.cpp|1|error: SFML/Graphics.hpp: No such file or directory|
D:\C++ Work\Test\Untitled3.cpp||In function 'int main()':|
D:\C++ Work\Test\Untitled3.cpp|5|error: 'sf' has not been declared|
D:\C++ Work\Test\Untitled3.cpp|5|error: expected ';' before 'window'|
D:\C++ Work\Test\Untitled3.cpp|6|error: 'sf' has not been declared|
D:\C++ Work\Test\Untitled3.cpp|6|error: expected ';' before 'shape'|
D:\C++ Work\Test\Untitled3.cpp|7|error: 'shape' was not declared in this scope|
D:\C++ Work\Test\Untitled3.cpp|7|error: 'sf' has not been declared|
D:\C++ Work\Test\Untitled3.cpp|9|error: 'window' was not declared in this scope|
D:\C++ Work\Test\Untitled3.cpp|11|error: 'sf' has not been declared|
D:\C++ Work\Test\Untitled3.cpp|11|error: expected ';' before 'event'|
D:\C++ Work\Test\Untitled3.cpp|12|error: 'event' was not declared in this scope|
D:\C++ Work\Test\Untitled3.cpp|14|error: 'sf' has not been declared|
||=== Build finished: 12 errors, 0 warnings ===|

3.And in a final I copied the include folder in the recompiled folder and give me the same errors as in point 1.

I using this file for SFML 2.0 LaurentGomila-SFML-2.0-rc-94-g26fa99f.tar ( posted if in case someone want the version)

Please if can someone help me or to figure out using TeamViewer. :(

P.S.: Sorry for my bad english.

Pages: 1 ... 7 8 [9]