Show / Hide Table of Contents

Enum CoordinateSpace

DrawRequests (DrawStage and DistortionStage) are transformed to World or Screen Coordinates by the properties of the chosen Camera2D at render time Screen coordinates are (0,0) in the middle of the Camera's view and extend half of the camera's virtual resolution along the x and y axis The axis are positive X to the right, and positive Y upwards in terms of screen orientation The top left corner of the screen is therefore location (-0.5 VirtualResolutionX, +0.5 VirtualResolutionY) The camera's resolution is virtual (not pixel based), as when a DrawStage is rendered onto a RenderTarget, the camera's view is rendered across the entire RenderTarget (or current viewport portion) If the virtual resolution does not match the pixel resolution of the RenderTarget or Viewport, then the resultant render is scaled to the target shape This enables window / system resolution to remain seperate from the logical positioning of objects in both Screen and World space

World coordinates are similar, but rendering position is transformed by both the camera's zoom and world focus point (and rotation) World axis are also (when the camera is not rotated) positive x to the right, and positive y upwards in terms of on-screen direction

Namespace: Yak2D
Assembly: Yak2D.Api.dll
Syntax
public enum CoordinateSpace : int

Fields

Name Description
Screen

Vertex positions are transformed simple in relation to the camera's current virtual resolution. The centre of the screen is position (0,0)

World

Vertex positions are transformed according to the camera's focal position, zoom factor and rotation

In This Article
Back to top yak2D - Alex Paterson