Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
0 registered members (), 1,498 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Mouse over panel question #245448
01/09/09 23:26
01/09/09 23:26
Joined: Aug 2007
Posts: 286
DestroyTheRunner Offline OP
Member
DestroyTheRunner  Offline OP
Member

Joined: Aug 2007
Posts: 286
Hi

I have a simple project where you click with the mouse somewhere in the level and my character walks until reach the place i´ve clicked, like a RTS game.

PROBLEM: I have some panels on the screen and whenever i click over the panel(on a button or whatever) it sends my character to the place i´ve clicked. Is there a way to detect that the mouse is over the (or any) panel and not trigger the function that sends the character to the place i´ve clicked?

INFO:
A6 6.4 standard

thanks smile

Re: Mouse over panel question [Re: DestroyTheRunner] #245456
01/10/09 00:37
01/10/09 00:37
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
From the manual of A6.60:
Quote:
mouse_range
Range within click, touch, or release events of entities can be triggered by the mouse (default 1000 quants).


I don't think that there is a function that tells you whether the mouse is over the panel. I would switch the mouse_range depending on which area of the screen your mouse is.

Re: Mouse over panel question [Re: Pappenheimer] #245493
01/10/09 10:55
01/10/09 10:55
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
There is a function but I think its A7 only.
I'll still post it here if someone else needs it: mouse_panel
link: http://www.conitec.net/beta/mouse_panel.htm

Re: Mouse over panel question [Re: Xarthor] #245567
01/10/09 18:44
01/10/09 18:44
Joined: Aug 2007
Posts: 286
DestroyTheRunner Offline OP
Member
DestroyTheRunner  Offline OP
Member

Joined: Aug 2007
Posts: 286
@papenheimer

Example:
mouse_range = 100; // only near Entities are clickable
from the manual.
where is the origin of this? is it from the mouse? camera? center of the level?

Anyway its not a good way for me because i have several panels with several different forms ( square, rectangular) and this range is probably spherical.
thanks anyway smile

@xarthor
yes, its a7 only frown

anyone else can help me with this?

Re: Mouse over panel question [Re: DestroyTheRunner] #245602
01/10/09 21:01
01/10/09 21:01
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
The range of the mouse is from the camera position and that of the mouse.
It has no scan cone because it is the rectangular ray of the screen of the camera.

If you are picky wink with the precision of the panels' positions then you have to store the positions of the pixels of the screen which are covered by the panels in an array or whatever you prefer.

Re: Mouse over panel question [Re: Pappenheimer] #245604
01/10/09 21:12
01/10/09 21:12
Joined: Aug 2007
Posts: 286
DestroyTheRunner Offline OP
Member
DestroyTheRunner  Offline OP
Member

Joined: Aug 2007
Posts: 286
I see
storing panels coordinates inside an array makes a lot of sense, although i dont how to do it yet, and havent thought how to do it, since like a RPG game, there will be several panels that will appear and disappear,but yeah, i will give some thought about that.

i just wonder if there's a easier way of doing it.

but thanks for the idea! smile

Re: Mouse over panel question [Re: DestroyTheRunner] #245606
01/10/09 21:26
01/10/09 21:26
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
i think you don't need an array, I thought you have shapes like a circle, dragon or whatever, but if they are all rectangular, then its easy.

When you click mouse_left then you need which panels are visible.
Getting the panel's position is easy, then you need its x size and y size.
With these values you can compare the mouse position to the panel's position and whether it is within the range of its x and y size.

Re: Mouse over panel question [Re: Pappenheimer] #245607
01/10/09 21:30
01/10/09 21:30
Joined: Aug 2007
Posts: 286
DestroyTheRunner Offline OP
Member
DestroyTheRunner  Offline OP
Member

Joined: Aug 2007
Posts: 286
actually, with the rectagular ones i already did this:
Quote:

Getting the panel's position is easy, then you need its x size and y size.
With these values you can compare the mouse position to the panel's position and whether it is within the range of its x and y size.


but i still have some different shapes like circle and trapezoid type...(not as hard as a dragon though, lol :p )

Re: Mouse over panel question [Re: DestroyTheRunner] #246006
01/12/09 23:27
01/12/09 23:27
Joined: Sep 2003
Posts: 733
Whitefish, Montana
JazzDude Offline
User
JazzDude  Offline
User

Joined: Sep 2003
Posts: 733
Whitefish, Montana
It seems you could just nullify the player movement whenever a panel opens.

Re: Mouse over panel question [Re: JazzDude] #246619
01/15/09 21:21
01/15/09 21:21
Joined: Aug 2007
Posts: 286
DestroyTheRunner Offline OP
Member
DestroyTheRunner  Offline OP
Member

Joined: Aug 2007
Posts: 286
but still the panels that remains open during the game, whenever i click over them it triggers the movement, thats why i need something to detect whenever my mouse is over a panel! frown


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