Way to Fake Mousepointer for OnMouseOver etc.

Feature requests for future versions of Hollywood can be voiced here
Post Reply
Bugala
Posts: 1253
Joined: Sun Feb 14, 2010 7:11 pm

Way to Fake Mousepointer for OnMouseOver etc.

Post by Bugala »

I am right now in a situation where I realised I might need to do quite a lot of work to get things working properly, but which could be solved by having a new command.

Situation is that I am about to make a CPU player, who will keep moving his hand to pick cards and push buttons.

Now these buttons/cards(which are buttons too) normally react when you move your mouse over them / out and click them. Idea is that since CPU player is basically similar to human player, therefore for example things that highlight when mouse goes over them, should also highlight when computers hand goes over them.

It would be handy if there would be command which I could use to tell Hollywood that MousePointer is now over location X, Y, even it isn't. This way I could move the computer hand, and every cycle do a check about mouse being over that same location as computer hand is, and problem would be solved.

Now I seem to have two options.

1. I make it so that I change computers hand as being the mousepointer, and keep moving the mouse pointer (easier, but also means that user cant use mouse during that time)

2. Make code to check computer hand against all the buttons manually, and also manually react to hand going onmouseover, onmouseout etc.

But having that DoMousePointerLocation(x, y, OptionalArg) command would solve the problem easiest. OptionalArg telling if mouse is for example doing OnMouseUp.
User avatar
jPV
Posts: 674
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Way to Fake Mousepointer for OnMouseOver etc.

Post by jPV »

Just send a fake event table for your event handling function? I have used this kind of method to simulate user key presses or menu choices to avoid writing duplicated code for different actions that would be doing the same thing anyway.
Bugala
Posts: 1253
Joined: Sun Feb 14, 2010 7:11 pm

Re: Way to Fake Mousepointer for OnMouseOver etc.

Post by Bugala »

Thanks. Didnt think that myself, but I think that will work.
Post Reply