You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to get the mouse position of the window (Preferably the canvas area and not the title bar at the top too). I am using this repo to make a pixel sandbox game. This repo is so awesome and simple and it works great with my work flow. But I just can't seem to find any way to get the mouse position. I see a few things online but they all need to work within the top level statement and I don't know how to do that.
Would you be willing to add this functionality? And Perhaps even keyboard key input and mouse button input?
I managed to add my own implementation but It only gets the mouse position on the monitor and not on the window:
Thank you!
The text was updated successfully, but these errors were encountered:
The PixelWindow repo is built on top of SFML.Net which is a .Net binding of SFML
In the Learn section of the official site you can see tutorials on how to do all sorts of things in SFML including input. Note that the tutorials use C++ as that is the language that the library is natively written in and available in, but the C# ends up being easy to figure out from their samples.
The PixelWindow system will give you a reference to the SFML RenderWindow in the OnLoad function. Store a copy of that in your app manager class when OnLoad runs, then you can use that to get the mouse pos relative to the window using
Mouse.GetPosition(_renderWindow);
There's also examples of key input in that game of life repo.
Hope this answers your question. I have no plans to add any kind of wrapper around the input to expose it within the PixelWindow class as there's a bunch of useful stuff that SFML exposes that you can use out of the box. As such the PixelWindow stuff will focus purely on pixel rendering, and for anything else you want to do, SFML can probably do it.
Ah I see, that is totally ok and I will do what you said thank you! Plan b with asking that question was to get pointed in the right direction so thanks!
Hi,
I would like to be able to get the mouse position of the window (Preferably the canvas area and not the title bar at the top too). I am using this repo to make a pixel sandbox game. This repo is so awesome and simple and it works great with my work flow. But I just can't seem to find any way to get the mouse position. I see a few things online but they all need to work within the top level statement and I don't know how to do that.
Would you be willing to add this functionality? And Perhaps even keyboard key input and mouse button input?
I managed to add my own implementation but It only gets the mouse position on the monitor and not on the window:
Thank you!
The text was updated successfully, but these errors were encountered: