* Simulates a "mouse button release". Used in circumstances * where the surface is unpressed without user input. * @param state Pointer to running state. */
| 226 | * @param state Pointer to running state. |
| 227 | */ |
| 228 | void InteractiveSurface::unpress(State *state) |
| 229 | { |
| 230 | if (isButtonPressed()) |
| 231 | { |
| 232 | _buttonsPressed = 0; |
| 233 | SDL_Event ev; |
| 234 | ev.type = SDL_MOUSEBUTTONUP; |
| 235 | ev.button.button = SDL_BUTTON_LEFT; |
| 236 | Action a = Action(&ev, 0.0, 0.0, 0, 0); |
| 237 | mouseRelease(&a, state); |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | /** |
| 242 | * Called every time there's a mouse press over the surface. |