Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / Set mouse positon?

Author
Message
Landmark
16
Years of Service
User Offline
Joined: 5th Feb 2010
Location:
Posted: 31st Aug 2010 17:07
Hi!,
I'd like to know if we can set mouse position x,y. For example, I want to place a trigger zone which do "pause game", then place the cursor in a specific screen position. Is that possible?
I will appreciate any help.

Thanks, Javier

Landmark
Gencheff
16
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 31st Aug 2010 17:31 Edited at: 31st Aug 2010 17:33
Yup.

:state=0:hudreset,hudx=50,hudy=50,hudimage=gamecore\huds\pointer.tga,hudmake=pointer

hudx and hudy are positions of the mouse

:plrwithinzone=1:pausegame

to pause game


Yeah I said it.FIRST PERSON SOCCER!
Landmark
16
Years of Service
User Offline
Joined: 5th Feb 2010
Location:
Posted: 1st Sep 2010 07:04
Gencheff, Thanks for your help, but mouse pointer appears at the same place all time after game pause even if I change coordinates.
As you can see in the code, I modified the trigger zone fpi "plrinzone" and added your code, but after the game pause, pointer show up allways at the same place instead the coordinates indicated. I will appreciate any help. Thanks, Javier


Landmark
Landmark
16
Years of Service
User Offline
Joined: 5th Feb 2010
Location:
Posted: 1st Sep 2010 07:07
Sorry, I tried x=-1777, y=-771 as you can see above, to try if pointer appears at upper left corner of my screen, but always pointer appears at the center of the screen instead. Could be something wrong with the code?
Thanks!

Landmark
Gencheff
16
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 1st Sep 2010 12:30
Yes,there is.

Coordinates are measured in PERCENTAGE,NOT PIXELS , meaning from 0 to 100.If you used the exact same code I gave you it will position the image in the center of the screen like usual.

Now another thing when adding images to the screen is they have an axis in the middle,meaning if you have a 1000px image and set it to 50 50 (center screen),the image wont start at 50% , but its center would be there.The other sides will be at less and more,depending on width.


Yeah I said it.FIRST PERSON SOCCER!
Landmark
16
Years of Service
User Offline
Joined: 5th Feb 2010
Location:
Posted: 1st Sep 2010 16:03
Gen,
I changed the HUDx and HUDy to 30/90, but when game pause, the cursor remain at the center instead to change its position. I tried with different positions and it still keep its position at the center again. When game pause, I can move the cursor with my mouse, but it appears all the time at the center instead position indicated in the code. What could be wrong? Please see the picture and code.

Thanks, Javier


Landmark
Gencheff
16
Years of Service
User Offline
Joined: 12th Jun 2010
Location: UK by way of USSR
Posted: 1st Sep 2010 16:14 Edited at: 1st Sep 2010 16:19
It works for me in the titlepage.fpi , so it should ingame as well.

I'll test it and see if It needs fixing

EDIT - nope,the script works for me.Although the x position doesnt want to work properly,the y is fine


Yeah I said it.FIRST PERSON SOCCER!

Login to post a reply

Server time is: 2026-07-04 15:03:57
Your offset time is: 2026-07-04 15:03:57