Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (1 invisible), 672 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mouse Release? #450972
04/26/15 07:41
04/26/15 07:41
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline OP
User
Dooley  Offline OP
User

Joined: May 2005
Posts: 868
Chicago, IL
Is there function or variable built into the engine that recognized when a mouse button is released?

I'm really surprised that I have never looked this up, and that it's not in the manual...

Re: Mouse Release? [Re: Dooley] #450976
04/26/15 09:29
04/26/15 09:29
Joined: Dec 2009
Posts: 82
D
Denn15 Offline
Junior Member
Denn15  Offline
Junior Member
D

Joined: Dec 2009
Posts: 82
im pretty sure that there is not however you can check it this way:

Code:
...
while(mouse_left)
{
   wait(1);
}
//mouse is released here
...


Last edited by Denn15; 04/26/15 09:29.
Re: Mouse Release? [Re: DLively] #450982
04/26/15 12:54
04/26/15 12:54
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
Code:
var mouse_activated = 0;
...

if(mouse_left && !mouse_activated){
    mouse_activated = 1;//activate the switch
    //The rest of your code here:
}
if(!mouse_left && mouse_activated){
    //your on release code here
    //mouse_activated = 0;//reset te switch
}


Last edited by DLively; 04/26/15 12:55.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Mouse Release? [Re: DLively] #451009
04/27/15 02:05
04/27/15 02:05
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
On top of that you can create a corresponding event yourself which gets triggered on mouse button release, for example as follows:

var mouse_left_off = 0;
Make a loop which deals with player input, then add something like this:
Code:
void handle_input()
{
while(1)
{
  ... keyboard input

  if(mouse_left) mouse_left_off = 0;
  else
  {
    if(!mouse_left_off) mouse_left_off_event(); // 
    mouse_left_off = 1;
  }
  wait(1);
}
}



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1