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

Author Topic: Detect click of a button on a matrix of buttons  (Read 6638 times)

0 Members and 1 Guest are viewing this topic.

NightZpy

  • Newbie
  • *
  • Posts: 7
    • View Profile
Detect click of a button on a matrix of buttons
« on: March 27, 2009, 06:53:18 am »
Hi there...
I' am newbie with SFML and have some dudes...
I want detect click in the matrix buttons (Button = sprite, with some things changed)...

This code make the detection of mouse click on area of sprite:
Code: [Select]

bool Boton::isMouseOverBoton(float mouseX, float mouseY)
{
    return (((mouseX >= this->xPos) && (mouseX <= this->xPosMax)) && ((mouseY >= this->yPos) && (mouseY <= this->yPosMax)));
}

//FunciĆ³n para evaluar si se ha clickeado sobre el boton
//Function for evaluate if has clicking over button
bool Boton::isMousePressedLeftBoton(sf::RenderWindow *ventana)
{
return (Boton::estado = Boton::isMouseOverBoton((float)ventana->GetInput().GetMouseX(), (float)ventana->GetInput().GetMouseX())  && ventana->GetInput().IsMouseButtonDown(sf::Mouse::Left));
}


This code is how try detect the click over some sprite:
Code: [Select]

if(ventana.GetInput().IsMouseButtonDown(sf::Mouse::Left))
{
for(int i=0; i<cBotones; i++)
{
for(int j=0; j<cBotones; j++)
{
if(boton[i][j].isMousePressedLeftBoton(&ventana))
{
boton[i][j].cambiarColor(sf::Color::Red);
}
}
}
}


But, not working!

Greetz...
I'am newbie and graphics programming, but SFML is very easy, simple and versatile!

Aval

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Detect click of a button on a matrix of buttons
« Reply #1 on: March 28, 2009, 12:47:52 am »
I haven't looked at your code closely, but you check for the mouse being down twice. That won't cause it to not work, but is sort of unnecessary. Just take out:

Code: [Select]
&& ventana->GetInput().IsMouseButtonDown(sf::Mouse::Left)

This will be more efficient.

Also, it isn't that great to put everything onto one line, as it makes the code more difficult to read.

Edit:
What is cBotones? If this is a square matrix, your code might work, but if it is the total amount of buttons, you'll get an error. Can you describe the error you get, or does it not compile?

NightZpy

  • Newbie
  • *
  • Posts: 7
    • View Profile
Detect click of a button on a matrix of buttons
« Reply #2 on: March 28, 2009, 03:10:28 am »
Quote from: "Aval"
...

Edit:
What is cBotones? If this is a square matrix, your code might work, but if it is the total amount of buttons, you'll get an error. Can you describe the error you get, or does it not compile?


cBotones is a count of number of buttons... Only a accountant!. I don't get nothing error, the code compile perfectly!.

Yeah:

Code: [Select]
if(ventana.GetInput().IsMouseButtonDown(sf::Mouse::Left))

Is redundant, just write for test some things...

boton is a matrix of squares (sprites=buttons).
This is the code of main while, for the capture of events:

Code: [Select]

bool activo = true;
    while(ventana.IsOpened() && activo)
    {
        sf::Event eventos;
        while (ventana.GetEvent(eventos))
        {

            if(eventos.Type == sf::Event::Closed)
            {
                ventana.Close();
                activo = false;
            }

            if ((eventos.Type == sf::Event::KeyPressed) && (eventos.Key.Code == sf::Key::Escape))
            {
                ventana.Close();
                activo = false;
            }
        }
for(int i=0; i<cBotones; i++)
{
for(int j=0; j<cBotones; j++)
{
if(boton[i][j].isMousePressedLeftBoton(&ventana))
{
boton[i][j].cambiarColor(sf::Color::Red);//Here changed the color of sprite of button
/*Just, some datas for the impotant info*/
cout<<endl<<"Boton["<<i<<"]["<<j<<"].x: "<<boton[i][j].getMaxPosX();
cout<<endl<<"Boton["<<i<<"]["<<j<<"].y: "<<boton[i][j].getMaxPosY();
}
}
}

        ventana.Clear();
        ventana.Draw(fondo);
for(int i=0; i<cBotones; i++)
{
for(int j=0; j<cBotones; j++)
{
ventana.Draw(boton[i][j].getFigura());//Here get the sprite of that button.
}
}
       
ventana.Display();
    }


Every time I click, it's as if you pressed a few times ... perhaps by the frame rate?[/code]
I'am newbie and graphics programming, but SFML is very easy, simple and versatile!

Aval

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Detect click of a button on a matrix of buttons
« Reply #3 on: March 28, 2009, 01:08:53 pm »
No, if you go past array bounds, it will compile fine but get a run-time error.

Assuming you got it to work, the reason you register multiple clicks is because you do not click as fast as the program runs. Instead, save the state of the mouse and when you check, just compare the current state to the last state-If it is different and the mouse is currently down, that is a click.

NightZpy

  • Newbie
  • *
  • Posts: 7
    • View Profile
Detect click of a button on a matrix of buttons
« Reply #4 on: March 28, 2009, 04:55:22 pm »
Quote from: "Aval"
No, if you go past array bounds, it will compile fine but get a run-time error.

Assuming you got it to work, the reason you register multiple clicks is because you do not click as fast as the program runs. Instead, save the state of the mouse and when you check, just compare the current state to the last state-If it is different and the mouse is currently down, that is a click.


Hi...

Look this video, you can see in operation the algorithm:


You can watch how make clicks in the firts row and occur in the same column but in another row!

I try your idea...

Greetz!
I'am newbie and graphics programming, but SFML is very easy, simple and versatile!

Aval

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Detect click of a button on a matrix of buttons
« Reply #5 on: March 28, 2009, 08:07:54 pm »
Assuming this is your matrix:

_______
|_|_|_|_|
|_|_|_|_|
|_|_|_|_|
|_|_|_|_|

Would cBotones be 16 or 4?

NightZpy

  • Newbie
  • *
  • Posts: 7
    • View Profile
Detect click of a button on a matrix of buttons
« Reply #6 on: March 28, 2009, 09:15:41 pm »
Quote from: "Aval"
Assuming this is your matrix:

_______
|_|_|_|_|
|_|_|_|_|
|_|_|_|_|
|_|_|_|_|

Would cBotones be 16 or 4?


cBotones = 8, then 8 * 8 = 64 that is the accountant of squares (Sprites or Buttons)...

You find the posible error?
I'am newbie and graphics programming, but SFML is very easy, simple and versatile!

Aval

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Detect click of a button on a matrix of buttons
« Reply #7 on: March 28, 2009, 11:18:36 pm »
Ah. That wouldn't cause an error then.

You're saying that when you click on a button, another button is being activated?

NightZpy

  • Newbie
  • *
  • Posts: 7
    • View Profile
Detect click of a button on a matrix of buttons
« Reply #8 on: March 29, 2009, 12:25:16 am »
Quote from: "Aval"
Ah. That wouldn't cause an error then.

You're saying that when you click on a button, another button is being activated?


Don't, i say "when a buttons has clicked that button is activated"...
I'am newbie and graphics programming, but SFML is very easy, simple and versatile!

Aval

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Detect click of a button on a matrix of buttons
« Reply #9 on: March 29, 2009, 03:13:19 pm »
Then what is not working?

NightZpy

  • Newbie
  • *
  • Posts: 7
    • View Profile
Detect click of a button on a matrix of buttons
« Reply #10 on: March 29, 2009, 04:32:12 pm »
Quote from: "Aval"
Then what is not working?


What the video...
When make the click over, for example: sprite in the position 200, 100 the sprite that is activated is 200, 200, if make click in 300, 100, is activated sprite in 300, 300!

The correct is, if make click en 100, 200, would activated 100, 200...

Watch the log:

[code]
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 84, 73
Button[0][0].minPos: 50, 50
Button[0][0].maxPos: 100, 100
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 143, 72
Button[1][1].minPos: 110, 110
Button[1][1].maxPos: 160, 160
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 184, 71
Button[2][2].minPos: 170, 170
Button[2][2].maxPos: 220, 220
-----------------------------------------------------------
Click is:
Mouse: 252, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 252, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 252, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 252, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 252, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 251, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 69
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 68
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 67
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 250, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 66
Button[3][3].minPos: 230, 230
Button[3][3].maxPos: 280, 280
-----------------------------------------------------------
Click is:
Mouse: 249, 65
Button[3][3].minPos: 230, 230
Button[3][3]
I'am newbie and graphics programming, but SFML is very easy, simple and versatile!

NightZpy

  • Newbie
  • *
  • Posts: 7
    • View Profile
Detect click of a button on a matrix of buttons
« Reply #11 on: March 29, 2009, 05:01:00 pm »
Already fixed, i used your idea "a variable that save the state of mouse"...

Here the code:

Code: [Select]

bool Boton::isMousePressedLeftBoton(sf::Vector2f mouseCoord, sf::RenderWindow *ventana)
{
return (Boton::estado = Boton::isMouseOverBoton(mouseCoord.x, mouseCoord.y)  && (ventana->GetInput().IsMouseButtonDown(sf::Mouse::Left)));
}


Here the code of while:
Code: [Select]


bool activo = true;
    while(ventana.IsOpened() && activo)
    {
        sf::Event eventos;
        while (ventana.GetEvent(eventos))
        {

            if(eventos.Type == sf::Event::Closed)
            {
                ventana.Close();
                activo = false;
            }

            if ((eventos.Type == sf::Event::KeyPressed) && (eventos.Key.Code == sf::Key::Escape))
            {
                ventana.Close();
                activo = false;
            }
        }

mouseCoord.x = (float)ventana.GetInput().GetMouseX();
mouseCoord.y = (float)ventana.GetInput().GetMouseY();

if(ventana.GetInput().IsMouseButtonDown(sf::Mouse::Left))
{
for(int i=0; i<cBotones; i++)
{
for(int j=0; j<cBotones; j++)
{
if(boton[i][j].isMousePressedLeftBoton(mouseCoord, &ventana))
{
boton[i][j].cambiarColor(sf::Color::Red);
cout<<endl<<"-----------------------------------------------------------";
cout<<endl<<"Click is: ";
cout<<endl<<"Mouse: "<<ventana.GetInput().GetMouseX()<<", "<<ventana.GetInput().GetMouseY();
cout<<endl<<"Button["<<i<<"]["<<j<<"].minPos: "<<boton[i][j].getPosX()<<", "<<boton[i][j].getPosY();
cout<<endl<<"Button["<<i<<"]["<<j<<"].maxPos: "<<boton[i][j].getMaxPosX()<<", "<<boton[i][j].getMaxPosY();
}
}
}
}

        ventana.Clear();
        ventana.Draw(fondo);
for(int i=0; i<cBotones; i++)
{
for(int j=0; j<cBotones; j++)
{
ventana.Draw(boton[i][j].getFigura());
}
}
       
ventana.Display();


Thanks for your help, Aval!
I'am newbie and graphics programming, but SFML is very easy, simple and versatile!