RenderTarget.MapCoordsToPixel Method (Vector2f, View)

SFML.Net

RenderTargetMapCoordsToPixel Method (Vector2f, View)
Convert a point from world coordinates to target coordinates This function finds the pixel of the render-target that matches the given 2D point. In other words, it goes through the same process as the graphics card, to compute the final position of a rendered point. Initially, both coordinate systems (world units and target pixels) match perfectly. But if you define a custom view or resize your render-target, this assertion is not true anymore, ie. a point located at (150, 75) in your 2D world may map to the pixel (10, 50) of your render-target -- if the view is translated by (140, 25). This version uses a custom view for calculations, see the other overload of the function if you want to use the current view of the render-target.

Namespace: SFML.Graphics
Assembly: sfmlnet-graphics-2 (in sfmlnet-graphics-2.dll) Version: 2.2.0.0 (2.2.0)
Syntax
Vector2i MapCoordsToPixel(
	Vector2f point,
	View view
)
Function MapCoordsToPixel ( 
	point As Vector2f,
	view As View
) As Vector2i
Vector2i MapCoordsToPixel(
	Vector2f point, 
	View^ view
)
abstract MapCoordsToPixel : 
        point : Vector2f * 
        view : View -> Vector2i 

Parameters

point
Type: SFML.SystemVector2f
Point to convert
view
Type: SFML.GraphicsView
The view to use for converting the point

Return Value

Type: Vector2i
The converted point, in target coordinates (pixels)
See Also