PDA

View Full Version : Page.CursorHide


yosik
08-10-2005, 11:29 AM
Suggestion:
Adding the above action, with True/false option.
A few advantages to that:
- Disabling mousing at runtime,
- Making your own custom made cursor, linking an image position to the mouse X and Y position

Yossi

Worm
08-10-2005, 12:03 PM
If it doesn't make it Yos


HideCursor(true); --Hides Cursor

HideCursor(false); --Shows Cursor



function HideCursor(blnHide)
if blnHide then
nResult = DLL.CallFunction(_SystemFolder.."\\User32.dll", "ShowCursor", 0, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
else
nResult = DLL.CallFunction(_SystemFolder.."\\User32.dll", "ShowCursor", 1, DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL);
end
end

yosik
08-10-2005, 03:27 PM
Yes, Oh Worm, King of the DLL world. Thank you, your majesty for the gifts you are granting us....

Thanks Man... :yes

Yossi

Worm
08-10-2005, 03:33 PM
It does bring up a point about the value passed. It'd be nice if the e_X and e_Y were say set to negative numbers when outside of the AMS window. Then you'd know to hide your sudo cursor, otherwise, its stuck at the edge of the window waiting for the mouse to re-enter.

yosik
08-10-2005, 03:44 PM
True,
But as there are no negative value, can't you use the page dimension and "push " the cursor off screen from the other side of the page? (>790 for example).


Yossi

JimS
08-11-2005, 05:13 AM
Good one Yosik. I have been trying to figure out a way to use additional cursors, for my next AMS addon. I would absolutely love it if AMS6 had a custom cursor option that let us dynamically load a (proper) cursor file of our own.

Barring that, your idea to use transparent png’s and the hidden cursor is brilliant. It will take a little math for the offset, (different for each png) to make sure you are aiming at the, well, I can’t think offhand what it’s called, but the sweet spot on the icon, the tip of the arrow, the actual pixel that measures a hit. It’s a work around that I hadn’t thought of, thank you. :yes

yosik
08-11-2005, 06:05 AM
As the registration point of an image in AMS is the top left point (BTW, we could use a custom registration point function.....), what you have to do is make sure that the "sweet spot" of your custom pointer matches that point.

Yossi

JimS
08-11-2005, 06:55 AM
I’m not sure that you would want to consider the registration of the picture. I was thinking that you would still use the registration of the mouse. I was also thinking that HideCursor only hid the cursor, not disabled it. Now that I think about it, it probably does disable the cursor, so you would have to rely on the registration of the picture.

Always about two steps ahead of me aren’t you? :)

yosik
08-11-2005, 07:28 AM
Previous experience with Flash...That's all.

Worm
08-11-2005, 07:33 AM
The trick I found is to be sure your cursor image is disabled, otherwise the mouse events fire eradically for objects because you pointe is always over the cursor image. By disabling the image, it works alright.

Drawbacks will be that the custom cursor won't work over a windowed object because of the mouse events for the page not firing while the cursor is over those objects. I could be mistaken, but I believe that there was a suggestion posted to have the page's mouse events be a "global" event which would solve this.



Previous experience with Flash...That's all.

JimS
08-11-2005, 07:55 AM
Thank you Worm. I spend the time to think about it, you spend the tome to do it, thanks.

Isn’t it exciting, how few lines of code that it takes to do something this cool? :yes

Corey
08-11-2005, 08:01 AM
Isn’t it exciting, how few lines of code that it takes to do something this cool?

It rocks. :yes

Darryl
08-11-2005, 11:11 AM
Suggestion added, thank you.

Darryl

REF: 10735