C# Класс Nez.Camera

Наследование: Component
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
farClipPlane3D float
nearClipPlane3D float
positionZ3D float

Открытые методы

Метод Описание
Camera ( ) : System
forceMatrixUpdate ( ) : void

this forces the matrix and bounds dirty

onEntityTransformChanged ( Transform comp ) : void
screenToWorldPoint ( Point screenPosition ) : Vector2

converts a point from screen coordinates to world

screenToWorldPoint ( Vector2 screenPosition ) : Vector2

converts a point from screen coordinates to world

setMaximumZoom ( float maxZoom ) : Camera

maximum non-scaled value (0 - float.Max) that the camera zoom can be. Defaults to 3

setMinimumZoom ( float minZoom ) : Camera

minimum non-scaled value (0 - float.Max) that the camera zoom can be. Defaults to 0.3

setPosition ( Vector2 position ) : Camera

shortcut to entity.transform.setPosition

setRotation ( float radians ) : Camera

shortcut to entity.transform.setRotation

setRotationDegrees ( float degrees ) : Camera

shortcut to entity.transform.setRotationDegrees

setZoom ( float zoom ) : Camera

sets the the zoom value which should be between -1 and 1. This value is then translated to be from minimumZoom to maximumZoom. This lets you set appropriate minimum/maximum values then use a more intuitive -1 to 1 mapping to change the zoom.

worldToScreenPoint ( Vector2 worldPosition ) : Vector2

converts a point from world coordinates to screen

zoomIn ( float deltaZoom ) : void
zoomOut ( float deltaZoom ) : void

Защищенные методы

Метод Описание
updateMatrixes ( ) : void

Приватные методы

Метод Описание
onSceneRenderTargetSizeChanged ( int newWidth, int newHeight ) : void

when the scene render target size changes we update the cameras origin and adjust the position to keep it where it was

Описание методов

Camera() публичный Метод

public Camera ( ) : System
Результат System

forceMatrixUpdate() публичный Метод

this forces the matrix and bounds dirty
public forceMatrixUpdate ( ) : void
Результат void

onEntityTransformChanged() публичный Метод

public onEntityTransformChanged ( Transform comp ) : void
comp Transform
Результат void

screenToWorldPoint() публичный Метод

converts a point from screen coordinates to world
public screenToWorldPoint ( Point screenPosition ) : Vector2
screenPosition Point Screen position.
Результат Vector2

screenToWorldPoint() публичный Метод

converts a point from screen coordinates to world
public screenToWorldPoint ( Vector2 screenPosition ) : Vector2
screenPosition Vector2 Screen position.
Результат Vector2

setMaximumZoom() публичный Метод

maximum non-scaled value (0 - float.Max) that the camera zoom can be. Defaults to 3
public setMaximumZoom ( float maxZoom ) : Camera
maxZoom float Max zoom.
Результат Camera

setMinimumZoom() публичный Метод

minimum non-scaled value (0 - float.Max) that the camera zoom can be. Defaults to 0.3
public setMinimumZoom ( float minZoom ) : Camera
minZoom float
Результат Camera

setPosition() публичный Метод

shortcut to entity.transform.setPosition
public setPosition ( Vector2 position ) : Camera
position Vector2
Результат Camera

setRotation() публичный Метод

shortcut to entity.transform.setRotation
public setRotation ( float radians ) : Camera
radians float Radians.
Результат Camera

setRotationDegrees() публичный Метод

shortcut to entity.transform.setRotationDegrees
public setRotationDegrees ( float degrees ) : Camera
degrees float Degrees.
Результат Camera

setZoom() публичный Метод

sets the the zoom value which should be between -1 and 1. This value is then translated to be from minimumZoom to maximumZoom. This lets you set appropriate minimum/maximum values then use a more intuitive -1 to 1 mapping to change the zoom.
public setZoom ( float zoom ) : Camera
zoom float Zoom.
Результат Camera

updateMatrixes() защищенный Метод

protected updateMatrixes ( ) : void
Результат void

worldToScreenPoint() публичный Метод

converts a point from world coordinates to screen
public worldToScreenPoint ( Vector2 worldPosition ) : Vector2
worldPosition Vector2 World position.
Результат Vector2

zoomIn() публичный Метод

public zoomIn ( float deltaZoom ) : void
deltaZoom float
Результат void

zoomOut() публичный Метод

public zoomOut ( float deltaZoom ) : void
deltaZoom float
Результат void

Описание свойств

farClipPlane3D публичное свойство

far clip plane of the 3D camera projection
public float farClipPlane3D
Результат float

nearClipPlane3D публичное свойство

near clip plane of the 3D camera projection
public float nearClipPlane3D
Результат float

positionZ3D публичное свойство

z-position of the 3D camera projections. Affects the fov greatly. Lower values make the objects appear very long in the z-direction.
public float positionZ3D
Результат float