RelativeScreenSpace ToPixelSpace Method (Vector2D)Delta Engine Documentation

Namespace: DeltaEngine.ScreenSpaces
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public override Vector2D ToPixelSpace(
	Vector2D currentScreenSpacePosition
)

Return Value

Type: Vector2D
Remarks

Tests: DeltaEngine.Tests.ScreenSpaces.RelativeScreenSpaceTests
Examples

1 unit tests call DeltaEngine.ScreenSpaces.RelativeScreenSpace.ToPixelSpace(DeltaEngine.Datatypes.Vector2D)
[Test]
public void ToPixelSpaceFromRelativeSpace()
{
    window.ViewportPixelSize = new Size(30, 50);
    var screen = new RelativeScreenSpace(window);
    Assert.AreEqual(new Vector2D(30, 50), screen.ToPixelSpace(Vector2D.One));
    Assert.AreEqual(Size.Zero, screen.ToPixelSpace(Size.Zero));
    Assert.AreEqual(new Vector2D(10, 20), screen.ToPixelSpace(new Vector2D(10 / 30.0f, 20 / 50.0f)));
    Assert.AreEqual(new Size(7.5f, 12.5f), screen.ToPixelSpace(new Size(0.25f)));
}
See Also