Hey guys,
Just came along another tricky thingie again. I'm sure the solution is quite easy - once you heared about it
I want to let my mouse first "spawn" direcly onto my sprite. There I wanted to add the sprites position to the mouse' new SetPosition(new Vector2i) method.
sadly anyhow these two kinds of positions dont match. I already read in the forums that there needs to be some kind of transformation from the local coords and the global screen coords.
Thought the 2nd Parameter for the SetPosition Method of Mouse would help here (Window toRelation). made it way worser.
Since this won't work my sprite/mouse movement morph won't work anyway. Actually I managed to follow the sprite by my mouse motions - but you know - it looks crappy if the sprite vanishes anywhere behind the window nether
heres a screeny:
The red cursor on the topleft position...thats where my cursor actually was while taking the screenyand some code snippets of my tryout:
float x = sprite.Position.X;
float y = sprite.Position.Y;
Mouse.SetPosition(new Vector2i((int)x, (int)y));