Fixed inverted Mouse-Y in World
This commit is contained in:
parent
fd53c73fa7
commit
0ab7f29b06
2 changed files with 4 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ namespace SM2D.Controls
|
||||||
public Vector2 InWorld()
|
public Vector2 InWorld()
|
||||||
{
|
{
|
||||||
var res = _window.WorldScale;
|
var res = _window.WorldScale;
|
||||||
|
res.Y *= -1;
|
||||||
return InScreenNormalized * res - res / 2;
|
return InScreenNormalized * res - res / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,19 +43,21 @@ namespace SM_TEST
|
||||||
window.Run();
|
window.Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DrawObject2D kasten;
|
||||||
private static DrawParticles particles;
|
private static DrawParticles particles;
|
||||||
private static void WindowOnUpdateFrame(object sender, FrameEventArgs e)
|
private static void WindowOnUpdateFrame(object sender, FrameEventArgs e)
|
||||||
{
|
{
|
||||||
if (Keyboard.GetState()[Key.R])
|
if (Keyboard.GetState()[Key.R])
|
||||||
particles.Trigger();
|
particles.Trigger();
|
||||||
//particles.Paused = Keyboard.GetState()[Key.P];
|
//particles.Paused = Keyboard.GetState()[Key.P];
|
||||||
|
kasten.Transform.Position.Set( window.Mouse.InWorld());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void WindowOnLoad(object sender, EventArgs e)
|
private static void WindowOnLoad(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//scene.ShowAxisHelper = true;
|
//scene.ShowAxisHelper = true;
|
||||||
|
|
||||||
DrawObject2D kasten = new DrawObject2D();
|
kasten = new DrawObject2D();
|
||||||
kasten.Texture = new Texture(new Bitmap("herosword.png"));
|
kasten.Texture = new Texture(new Bitmap("herosword.png"));
|
||||||
kasten.Transform.ApplyTextureSize(kasten.Texture, 500);
|
kasten.Transform.ApplyTextureSize(kasten.Texture, 500);
|
||||||
scene.Objects.Add(kasten);
|
scene.Objects.Add(kasten);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue