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 - MrMou6

Pages: [1] 2
1
General / Re: Function argumet.
« on: September 18, 2017, 12:44:40 am »
So its not possible to check that is mouse on button or not?

2
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

3
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:


4
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)

5
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?

6
General / Re: Pixels counting
« on: September 08, 2017, 08:46:53 pm »
Thanks, my problem was that I not insert window like argument :D

7
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?

8
General / Re: ERROR about color
« on: September 07, 2017, 07:31:59 pm »
I found that... Thank you for the help :D

9
General / Re: ERROR about color
« on: September 07, 2017, 07:07:12 pm »
My bad... Thanks :D

now error its fixed but my screen is not filled with a color :(

Code:
Quote
int main()
{
   sf::RenderWindow langas(sf::VideoMode(800, 600), "SM Bettings");
   
   while (langas.isOpen()) {
      sf::Event ev;
      while (langas.pollEvent(ev)) {

         if (ev.type == sf::Event::Closed)
            langas.close();
         if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
            langas.close();
      }
   }

   langas.clear(sf::Color::Green);
   langas.display();
   return 0;
}

10
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);

11
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?

12
Graphics / click on sprite
« on: August 31, 2011, 08:19:10 am »
Quote from: "Damian"

I helped you. But i see that you dont have any idea on game prgramming ;). At first you must know C++ better and Do some console games (CLI). Text based. Dont try make 2d/3d games right now! Learn at first!



OK!

13
Graphics / click on sprite
« on: August 29, 2011, 07:27:08 pm »
triogonometry and geometry it's fine...

14
Graphics / click on sprite
« on: August 29, 2011, 10:26:03 am »
sorry. i try this:
Code: [Select]
if (sprite.GetPosition().x * GetPosition().y == Window.GetInput().IsMouseButtonDown(sf::Mouse::Left))
but:
Code: [Select]
Window.GetInput().IsMouseButtonDown(sf::Mouse::Left))
is wrong..Nexus can you give me link to tut... How get mouse position..


Sorry for my english.

15
Graphics / click on sprite
« on: August 28, 2011, 09:41:51 pm »
i try this:
Code: [Select]
if (sprite.GetPosition().x + sprite.GetSize().x == Window.GetInput().IsMouseButtonDown(sf::Mouse::Left))
but this is not work :(

Pages: [1] 2