OrthogonalWidth
Introduction
The OrthogonalWidth and OrthogonalHeight of a LayerCameraSettings object controls the number of units wide and high that the Layer will display. The LayerCameraSettings' Orthogonal value must be true for the OrthogonalWidth and OrthogonalHeight properties to apply.
Orthogonal Examples
This example was initially constructed in Glue. To reproduce this:
Create a Screen
Add a Sprite to the Screen
Create a 2D Layer
Place the Sprite on the 2D Layer
Matching Layer to Camera coordinates
You can match the LayerCameraSettings to match the Camera by setting the OrthogonalWidth/OrthogonalHeight of the LayerCameraSettings to the Camera's OrthogonalWidth/OrthogonalHeight. This assumes that both the Layer and Camera are using orthogonal values.
Using Orthogonal values
Orthogonal values can be used to determine the width and height in world coordinates of the area that a Layer displays. Usually these coordinates happen to match the pixel display area as well, but it is possible for this to not be the case if destination rectangle values are set differently from orthogonal values. The following code will size a Sprite so that it is the same size as the displayed area of a Layer:
Last updated