Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Buttons #347100
11/12/10 14:54
11/12/10 14:54
Joined: Sep 2005
Posts: 96
L
lyingmime Offline OP
Junior Member
lyingmime  Offline OP
Junior Member
L

Joined: Sep 2005
Posts: 96
Hey JCL, I'm just wondering why button functions are not called if the left mouse button is held down?

Re: Buttons [Re: lyingmime] #347450
11/15/10 14:57
11/15/10 14:57
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Do you mean manoeuvers like holding the left button down and pressing the right button at the same time? We're forbidden by our medical supervisor to implement events of this kind.

Re: Buttons [Re: jcl] #347528
11/15/10 22:35
11/15/10 22:35
Joined: Sep 2005
Posts: 96
L
lyingmime Offline OP
Junior Member
lyingmime  Offline OP
Junior Member
L

Joined: Sep 2005
Posts: 96
Really? That's funny. But no, I mean if only the left mouse is held functionOn, functionOff, and functionOver are not called--though the button image will swap between bmapOn and bmapOff.

So say the player left clicks to grab something and drags it over to a slot, I want to be able to have events trigger that indicate whether that item can or cannot go in that slot--you know, just by mousing over while the left mouse is held down. And then again, if the player drags the item away from that slot, have the message removed.

You can test this really easily with
Quote:
PANEL* test_button = {
bmap = "panel.png";
flags = SHOW;
button(2, 2, "down.png", "off.png", "over.png", buttonOn, buttonOff, buttonOn);
}

BMAP* arrow = "arrow.pcx";
BMAP* rev_arrow = "rev_arrow.pcx";

function buttonOn(){
mouse_map = arrow;
}

function buttonOff(){
mouse_map = rev_arrow;
}


The mouse cursor will change if you mouse over and change back if you mouse away. But nothing happens if you mouse over while mouse left is held.

*lyingmime

Re: Buttons [Re: lyingmime] #347570
11/16/10 15:23
11/16/10 15:23
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
I, personally, wouldn't want a button to react when I hold down the mouse button and move over it AT ALL. So, what bugs me about the GS buttons is that the images change.

But that's why I made LBGUI, and even before that I used my own buttons instead of the GS buttons...

Re: Buttons [Re: Lukas] #347574
11/16/10 15:48
11/16/10 15:48
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
This is no bug, but was just programmed this way. The image changes when the mouse is over the button, but an event is only triggered when you click inside the button area.

But if you want a different behavior, you can individually detect the pressed buttons, and set the button images in any way you want.


Moderated by  HeelX, Spirit 

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