Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: eri0o on Sun 03/06/2018 02:12:18

Title: Does a Mouse.Click should trigger a on_mouse_click event?
Post by: eri0o on Sun 03/06/2018 02:12:18
Does a Mouse.Click should trigger a on_mouse_click event? If they are in different modules, does order matter? Does Mouse.Click holds button down (for Mouse.isButtonDown) for a single tick?
Title: Re: Does a Mouse.Click should trigger a on_mouse_click event?
Post by: Crimson Wizard on Sun 03/06/2018 11:03:14
Quote from: eri0o on Sun 03/06/2018 02:12:18
Does a Mouse.Click should trigger a on_mouse_click event?
Yes, it should.

Quote from: eri0o on Sun 03/06/2018 02:12:18
If they are in different modules, does order matter?
No order should not matter, and the click is handled not immediately, but at the next engine update.

Quote from: eri0o on Sun 03/06/2018 02:12:18
Does Mouse.Click holds button down (for Mouse.isButtonDown) for a single tick?
No, it does not save button state.

Currently Mouse.Click works through same hack plugin's SimulateMouseClick works. It also allows one button at update.
Title: Re: Does a Mouse.Click should trigger a on_mouse_click event?
Post by: eri0o on Sun 03/06/2018 14:16:24
Thanks CW! I was doing some testing, and Mouse.Click indeed trigger and order does not matter. Only weird behaviour I had was that once on_mouse_click captures,and proceeds to trigger different Room.ProcessClick, the one that did Room.ProcessClick(mouse.x,mouse.y,eModeWalkto) wasn't making the player walk while all other eMode were working.

But I think it was a problem with some other module. So now knowing the intended behaviour I think I solved it - it was some other function that checked for isButtonDown that had no button down.