Community Forum

Mouse position in world.

Forum Overview >> Farming Simulator 15

CategoryFarming Simulator 15
Created15.07.2015 19:50

Martin Fabik (Hungar) 15.07.2015 20:03

I try to create script like interactive control but for outside of vehicle. So I must know position of mouse on screen but in world (as player) I can't use :mouseEvent(...) callback. Is there any way to catch mouse position via fuction?

Martin Fabík.

Emil Drefers (Unknown) 16.07.2015 08:36

the class "player" has the mouseEvent() too.
You could overwrite that function (by using Utils.overwrittenFunction()), execute the original one and then do what ever you want to do ; )


Martin Fabik (Hungar) 16.07.2015 13:20

thanks a lot. I tried to save mouse position this way but this is too complicated. So I choose to use InputBinding.mousePosYLast and InputBinding.mousePosXLast variables because I don't wanna do anything else in mouseEvent().

Martin Fabík

Note: Log in to post. Create a new account here.