CursorPositionTranslaterTests GetClientPositionOnScreen Method Delta Engine Documentation

Namespace: DeltaEngine.Input.Windows.Tests
Assembly: DeltaEngine.Input.Windows.Tests (in DeltaEngine.Input.Windows.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void GetClientPositionOnScreen()
Examples

[Test, CloseAfterFirstFrame]
public void GetClientPositionOnScreen()
{
    var window = Resolve<Window>();
    var translator = new CursorPositionTranslater(window);
    var outsidePosition = Resolve<ScreenSpace>().FromPixelSpace(new Vector2D(-10, -10));
    var screenPos = translator.ToScreenPositionFromScreenSpace(outsidePosition);
    Assert.IsTrue(screenPos.X < window.PixelPosition.X || screenPos.Y < window.PixelPosition.Y);
    Assert.AreEqual(outsidePosition, translator.FromScreenPositionToScreenSpace(screenPos));
}
See Also