Jump to content

Position of mouse cursor on ingame screen (C#)


Recommended Posts


What is the simplest way to check with C# code the current position of mouse cursor, on the game screen (while holding Alt)? Ive looked through the forum, API documentation and inside open source mods. Found out actually, that theres some solution for it in the ICoreClientAPI interface, but unfortunately i dont understand how to use it properly in my code.

My point was to be able to check the current mouse position inside the "OnHeldInteractStep" method (while holding alt + right mouse click). But i cant properly figure out, how to access "ICoreClientAPI" interface in "OnHeldInteractStep" method. Im sorry if the problem sounds obvious - im not very experienced in the C# language, just trying to learn more about creating mods for the Vintage Story.

Would really appreciate if someone could help or point me into the right direction. Thanks


Topic can be closed. Found proper solution to my problem, while watching through the different scripts and examples once again. If someone struggle with similar problem, i would recommend checking and analyzing the sources of official mod examples, which are available here: https://github.com/anegostudios/vstutorialmods and https://github.com/anegostudios/vsmodexamples

Edited by nnve
Link to comment
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.