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
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
mouse over panel #178295
01/17/08 10:32
01/17/08 10:32
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline OP
Senior Member
kasimir  Offline OP
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
I try to find out when the mouse is over a panel...

i tried it with changing the mouse_map: "panelxxx.mouse_map = ..." but if i use "if(mouse_map == ... " it does not work ...

i don't want to use the coordinates of the panels to compare them with the mouse_pos...

pls help - thx kasimir

Re: mouse over panel [Re: kasimir] #178296
01/18/08 03:24
01/18/08 03:24
Joined: Sep 2003
Posts: 281
Arkansas\USA
raiden Offline
Member
raiden  Offline
Member

Joined: Sep 2003
Posts: 281
Arkansas\USA
Hi kasimir

If you check out "button" in the manual, you will find the answer you are looking for.

You can make the image you want check for mouse touch events ny making it a button in a panel. Then using logic, you can test if you have touched it with the mouse.

Code:


function touch_function(button_number,panel)
{
if(panel == touch_panel && button_number == 1 && event_type == event_touch)
{
// you touched the touch_panel and the image with the mouse
// do work here
}
}

bmap touch_image = <your_file.bmp>;

panel touch_panel =
{
button(50,50,touch_image,touch_image,touch_image,null,null,touch_function;
flags = visible;
}



That is how I would do it.

Hope this helps you out.

-raiden


"It doesn't matter if we win or lose, it's how we make the game."
--------------------
Links: 3DGS for Dummies
Re: mouse over panel [Re: raiden] #178297
01/18/08 07:32
01/18/08 07:32
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
kasimir Offline OP
Senior Member
kasimir  Offline OP
Senior Member

Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
Thx but i don't understand why 3D-GS do not include a function... if its possible to change the mouse_map over panels....

Re: mouse over panel [Re: kasimir] #178298
01/18/08 12:07
01/18/08 12:07
Joined: Sep 2003
Posts: 281
Arkansas\USA
raiden Offline
Member
raiden  Offline
Member

Joined: Sep 2003
Posts: 281
Arkansas\USA
You can do that by simply definig your new mouse maps:

bmap new_mouse_map = <mouse_map2.tga>;

Then change it where I commented in my above code thats says:

//do work here
mouse_map = new_mouse_map;

-raiden


"It doesn't matter if we win or lose, it's how we make the game."
--------------------
Links: 3DGS for Dummies

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