0 registered members (),
1,498
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Mouse over panel question
#245448
01/09/09 23:26
01/09/09 23:26
|
Joined: Aug 2007
Posts: 286
DestroyTheRunner
OP
Member
|
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
|
|
|
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
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
From the manual of A6.60: 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: Xarthor]
#245567
01/10/09 18:44
01/10/09 18:44
|
Joined: Aug 2007
Posts: 286
DestroyTheRunner
OP
Member
|
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 @xarthor yes, its a7 only 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
Senior Expert
|
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 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
OP
Member
|
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!
|
|
|
Re: Mouse over panel question
[Re: Pappenheimer]
#245607
01/10/09 21:30
01/10/09 21:30
|
Joined: Aug 2007
Posts: 286
DestroyTheRunner
OP
Member
|
OP
Member
Joined: Aug 2007
Posts: 286
|
actually, with the rectagular ones i already did this: 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 )
|
|
|
|