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.


Topics - MrMou6

Pages: [1]
1
General / Function argumet.
« on: September 18, 2017, 12:33:01 am »
Hello I tried to do a function:
bool MouseOnButton(sf::RenderWindow windowName, int minX, int maxX, int minY, int maxY) {
        if (sf::Mouse::getPosition(windowName).x > minX && sf::Mouse::getPosition(windowName).x < maxX &&
                sf::Mouse::getPosition(windowName).y > minY && sf::Mouse::getPosition(windowName).y < maxY)
                return true;
        else return false;
}
and when Im trying to check it:


So, what is worng with my "sf::RenderWindow" variable like argument? :D

2
General / double variable
« on: September 14, 2017, 05:22:43 am »
Hello, how I can do that double variable shows only 2 numbers after dot let say:
20.00
not:
20.00000
Quote
double money = 20;
....
         sf::Text walletsk;
         walletsk.setFont(calibri);
         walletsk.setCharacterSize(18);
         walletsk.setFillColor(sf::Color::White);
         walletsk.setPosition(sf::Vector2f(660, 25));
         walletsk.setString(to_string(money));
...
window.draw(walletsk);
But i get result:


3
General / Win32 console
« on: September 13, 2017, 05:05:34 am »
Maybye someone can explain how to turn off win 32 console in visual studio 2017? because im getting 2 windows. One is my created sf::rendervideo and another one is win32 console(but I dont need it)

4
General / white screen
« on: September 11, 2017, 09:34:57 pm »
Hello, when i turn on my program its show white screen until i move mouse on window. Maybye someone know why?

5
General / Pixels counting
« on: September 08, 2017, 07:56:09 pm »
Hello. I make a button:
Quote
         sf::RectangleShape button1(sf::Vector2f(250, 70));
         button1.setPosition(sf::Vector2f(350, 200));
And now i need do somethink if player pressed on this button:
Quote
         if (menu == 0) {
            if (sf::Mouse::getPosition().x > 250 && sf::Mouse::getPosition().x < 600 &&
               sf::Mouse::getPosition().y > 200 && sf::Mouse::getPosition().y < 270) {
               if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) menu = 1;
            }
but menu = 1 if i pressed in another place (not on button1). Can someone explain me why?

6
General / ERROR about color
« on: September 07, 2017, 06:51:00 pm »
Hello. WHy I get this error?
Quote
error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Blue" (?Blue@Color@sf@@2V12@B)
code:
Quote
window.clear(sf::Color::Blue);

7
Graphics / Window right and left sides
« on: February 24, 2015, 03:37:36 pm »
Hi, i draw two rectangles:
padas1.setPosition(sf::Vector2f(10, (waukstis/2)-25));
padas2.setPosition(sf::Vector2f(wilgis-10, (waukstis / 2) - 25));
and i get this:

why these spaces is different?

8
Graphics / click on sprite
« on: August 23, 2011, 03:47:12 pm »
How i can do code:
when i click on my sprite... My program do something...
P.S. [Sorry for my english]

Pages: [1]