30.09.2020
+ Mouse support + Started to add summaries to SM.Base
This commit is contained in:
parent
16366fa015
commit
7acdba92f8
21 changed files with 325 additions and 58 deletions
22
SMCode/SM2D/Controls/Mouse2D.cs
Normal file
22
SMCode/SM2D/Controls/Mouse2D.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using OpenTK;
|
||||
using OpenTK.Input;
|
||||
using SM.Base;
|
||||
using SM.Base.Controls;
|
||||
using SM2D.Scene;
|
||||
|
||||
namespace SM2D.Controls
|
||||
{
|
||||
public class Mouse2D : Mouse<GLWindow2D>
|
||||
{
|
||||
protected internal Mouse2D(GLWindow2D window) : base(window)
|
||||
{ }
|
||||
|
||||
internal new void MouseMoveEvent(MouseMoveEventArgs mmea) => base.MouseMoveEvent(mmea);
|
||||
|
||||
public Vector2 InWorld(Camera cam)
|
||||
{
|
||||
Vector2 res = _window.WorldScale;
|
||||
return InScreenNormalized * res - res / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue