Jump to content


Photo

Opposite of mouse_check_button


  • Please log in to reply
7 replies to this topic

#1 ChefDavid22

ChefDavid22

    No, YOU shut up!

  • GMC Member
  • 1193 posts
  • Version:GM:Studio

Posted 20 May 2012 - 01:50 PM

Cant figure out how add an event for an onrelease of a button that is stationary on the screen. I know how to check if the image is pressed :

  if mouse_check_button(mb_left)
   {
    if (collision_point(mouse_x,mouse_y,id,true,false) >= 0)
    {
    obj_ship.speed=6;
    }
   }

But is there an opposite event for checking if it was released?
  • 0

#2 fluidic ice

fluidic ice

    GMC Member

  • GMC Member
  • 792 posts
  • Version:GM:Studio

Posted 20 May 2012 - 01:51 PM

mouse_check_button_released
;)

Edited by fluidic ice, 20 May 2012 - 01:52 PM.

  • 0

#3 ChefDavid22

ChefDavid22

    No, YOU shut up!

  • GMC Member
  • 1193 posts
  • Version:GM:Studio

Posted 20 May 2012 - 01:54 PM

As I was typing it I KNEW it was going to be something simple like that. Thanks as always.
  • 0

#4 fluidic ice

fluidic ice

    GMC Member

  • GMC Member
  • 792 posts
  • Version:GM:Studio

Posted 20 May 2012 - 02:01 PM

For something like hitting an object moving across a room I would use mouse_check_button_pressed, instead of released. I use released for closing windows etc and they are very similar in use except there's a slight delay when using released (the time of the click).
  • 0

#5 ChefDavid22

ChefDavid22

    No, YOU shut up!

  • GMC Member
  • 1193 posts
  • Version:GM:Studio

Posted 20 May 2012 - 02:11 PM

Wow I started looking at it and it turns out I already coded the thing in there, I just did something wrong and need to figure out what. *sigh*

EDIT: I should say that what i coded works on windows -just not android. So I just need to work through it

Edited by ChefDavid22, 20 May 2012 - 02:15 PM.

  • 0

#6 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 16795 posts
  • Version:GM:Studio

Posted 20 May 2012 - 02:31 PM

If you are coding for devices, you are better to use the device_mouse_* functions as that is what they were designed for....
  • 0

#7 ChefDavid22

ChefDavid22

    No, YOU shut up!

  • GMC Member
  • 1193 posts
  • Version:GM:Studio

Posted 20 May 2012 - 03:14 PM

Good to know. Something to new to read up on now.
  • 0

#8 Jobo

Jobo

    No neurons left today

  • GMC Member
  • 2405 posts
  • Version:GM:Studio

Posted 20 May 2012 - 03:39 PM

Fun fact: the opposite of mouse_check_button() is !mouse_check_button() (pronounced: not mouse_check_button()).
The opposite of mouse_check_button_pressed() is what you were looking for; mouse_check_button_released().
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users