C# Класс FlatRedBall.Camera

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

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

Свойство Тип Описание
BackgroundColor Color
DrawToScreen bool
RenderOrder List
UpVector Vector3

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

Метод Описание
AbsoluteBottomYEdgeAt ( float absoluteZ ) : float
AbsoluteLeftXEdgeAt ( float absoluteZ ) : float
AbsoluteRightXEdgeAt ( float absoluteZ ) : float
AbsoluteTopYEdgeAt ( float absoluteZ ) : float
FixAspectRatioXConstant ( ) : void
FixAspectRatioYConstant ( ) : void

Sets the aspectRatio to match the width/height of the area that the camera is drawing to.

This is usually used in applications with split screen or when on a widescreen display.

GetZDistanceForPixelPerfect ( ) : float
IsPointInView ( double x, double y, double absoluteZ ) : bool
IsSpriteInView ( Sprite sprite ) : bool
IsSpriteInView ( Sprite sprite, bool relativeToCamera ) : bool
IsTextInView ( Text text ) : bool
IsXInView ( double x, double absoluteZ ) : bool

Determines if the X value is in view, assuming the camera is viewing down the Z axis.

Currently, this method assumes viewing down the Z axis.

IsYInView ( double y, double absoluteZ ) : bool

Determines if the Y value is in view, assuming the camera is viewing down the Z axis.

Currently, this method assumes viewing down the Z axis.

PixelsPerUnitAt ( Vector3 &absolutePosition ) : float
PixelsPerUnitAt ( Vector3 &absolutePosition, float fieldOfView, bool orthogonal, float orthogonalHeight ) : float
PixelsPerUnitAt ( float absoluteZ ) : float

Returns the number of pixels per unit at the given absolute Z value. Assumes that the Camera is unrotated.

If using the PixelsPerUnitAt for a rotated camera, use the overload which takes a Vector3 argument.

RelativeXEdgeAt ( float absoluteZ ) : float
RelativeXEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalWidth ) : float
RelativeYEdgeAt ( float absoluteZ ) : float
RelativeYEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalHeight ) : float
UsePixelCoordinates ( bool moveCornerToOrigin, int desiredWidth, int desiredHeight ) : void

Sets the camera to Orthogonal, sets the OrthogonalWidth and OrthogonalHeight to match the argument values, and can move the so the bottom-left corner of the screen is at the origin.

UsePixelCoordinates3D ( float zToMakePixelPerfect ) : void
WorldXAt ( float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth, float screenX ) : float
WorldXAt ( float screenX, float zPosition ) : float
WorldXAt ( float screenX, float zPosition, Layer layer ) : float
WorldXAt ( float screenX, float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth ) : float
WorldYAt ( float zPosition, bool orthogonal, float orthogonalHeight, float screenY ) : float
WorldYAt ( float screenY, float zPosition ) : float
WorldYAt ( float screenY, float zPosition, Layer layer ) : float
WorldYAt ( float screenY, float zPosition, bool overridingOrthogonal, float overridingOrthogonalHeight ) : float

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

Метод Описание
Color ( ) : System
GetWorldXGivenHorizontalPercentage ( float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth, float horizontalPercentage ) : float

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

AbsoluteBottomYEdgeAt() публичный метод

public AbsoluteBottomYEdgeAt ( float absoluteZ ) : float
absoluteZ float
Результат float

AbsoluteLeftXEdgeAt() публичный метод

public AbsoluteLeftXEdgeAt ( float absoluteZ ) : float
absoluteZ float
Результат float

AbsoluteRightXEdgeAt() публичный метод

public AbsoluteRightXEdgeAt ( float absoluteZ ) : float
absoluteZ float
Результат float

AbsoluteTopYEdgeAt() публичный метод

public AbsoluteTopYEdgeAt ( float absoluteZ ) : float
absoluteZ float
Результат float

FixAspectRatioXConstant() публичный метод

public FixAspectRatioXConstant ( ) : void
Результат void

FixAspectRatioYConstant() публичный метод

Sets the aspectRatio to match the width/height of the area that the camera is drawing to.
This is usually used in applications with split screen or when on a widescreen display.
public FixAspectRatioYConstant ( ) : void
Результат void

GetZDistanceForPixelPerfect() публичный метод

public GetZDistanceForPixelPerfect ( ) : float
Результат float

IsPointInView() публичный метод

public IsPointInView ( double x, double y, double absoluteZ ) : bool
x double
y double
absoluteZ double
Результат bool

IsSpriteInView() публичный метод

public IsSpriteInView ( Sprite sprite ) : bool
sprite Sprite
Результат bool

IsSpriteInView() публичный метод

public IsSpriteInView ( Sprite sprite, bool relativeToCamera ) : bool
sprite Sprite
relativeToCamera bool
Результат bool

IsTextInView() публичный метод

public IsTextInView ( Text text ) : bool
text Text
Результат bool

IsXInView() публичный метод

Determines if the X value is in view, assuming the camera is viewing down the Z axis.
Currently, this method assumes viewing down the Z axis.
public IsXInView ( double x, double absoluteZ ) : bool
x double The absolute X position of the point.
absoluteZ double The absolute Z position of the point.
Результат bool

IsYInView() публичный метод

Determines if the Y value is in view, assuming the camera is viewing down the Z axis.
Currently, this method assumes viewing down the Z axis.
public IsYInView ( double y, double absoluteZ ) : bool
y double The absolute Y position of the point.
absoluteZ double The absolute Z position of the point.
Результат bool

PixelsPerUnitAt() публичный метод

public PixelsPerUnitAt ( Vector3 &absolutePosition ) : float
absolutePosition Vector3
Результат float

PixelsPerUnitAt() публичный метод

public PixelsPerUnitAt ( Vector3 &absolutePosition, float fieldOfView, bool orthogonal, float orthogonalHeight ) : float
absolutePosition Vector3
fieldOfView float
orthogonal bool
orthogonalHeight float
Результат float

PixelsPerUnitAt() публичный метод

Returns the number of pixels per unit at the given absolute Z value. Assumes that the Camera is unrotated.
If using the PixelsPerUnitAt for a rotated camera, use the overload which takes a Vector3 argument.
public PixelsPerUnitAt ( float absoluteZ ) : float
absoluteZ float The absolute Z position.
Результат float

RelativeXEdgeAt() публичный метод

public RelativeXEdgeAt ( float absoluteZ ) : float
absoluteZ float
Результат float

RelativeXEdgeAt() публичный метод

public RelativeXEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalWidth ) : float
absoluteZ float
fieldOfView float
aspectRatio float
orthogonal bool
orthogonalWidth float
Результат float

RelativeYEdgeAt() публичный метод

public RelativeYEdgeAt ( float absoluteZ ) : float
absoluteZ float
Результат float

RelativeYEdgeAt() публичный метод

public RelativeYEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalHeight ) : float
absoluteZ float
fieldOfView float
aspectRatio float
orthogonal bool
orthogonalHeight float
Результат float

UsePixelCoordinates() публичный метод

Sets the camera to Orthogonal, sets the OrthogonalWidth and OrthogonalHeight to match the argument values, and can move the so the bottom-left corner of the screen is at the origin.
public UsePixelCoordinates ( bool moveCornerToOrigin, int desiredWidth, int desiredHeight ) : void
moveCornerToOrigin bool Whether the camera should be repositioned /// so the bottom left is at the origin.
desiredWidth int The desired unit width of the view.
desiredHeight int The desired unit height of the view.
Результат void

UsePixelCoordinates3D() публичный метод

public UsePixelCoordinates3D ( float zToMakePixelPerfect ) : void
zToMakePixelPerfect float
Результат void

WorldXAt() публичный метод

public WorldXAt ( float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth, float screenX ) : float
zPosition float
overridingOrthogonal bool
overridingOrthogonalWidth float
screenX float
Результат float

WorldXAt() публичный метод

public WorldXAt ( float screenX, float zPosition ) : float
screenX float
zPosition float
Результат float

WorldXAt() публичный метод

public WorldXAt ( float screenX, float zPosition, Layer layer ) : float
screenX float
zPosition float
layer Layer
Результат float

WorldXAt() публичный метод

public WorldXAt ( float screenX, float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth ) : float
screenX float
zPosition float
overridingOrthogonal bool
overridingOrthogonalWidth float
Результат float

WorldYAt() публичный метод

public WorldYAt ( float zPosition, bool orthogonal, float orthogonalHeight, float screenY ) : float
zPosition float
orthogonal bool
orthogonalHeight float
screenY float
Результат float

WorldYAt() публичный метод

public WorldYAt ( float screenY, float zPosition ) : float
screenY float
zPosition float
Результат float

WorldYAt() публичный метод

public WorldYAt ( float screenY, float zPosition, Layer layer ) : float
screenY float
zPosition float
layer Layer
Результат float

WorldYAt() публичный метод

public WorldYAt ( float screenY, float zPosition, bool overridingOrthogonal, float overridingOrthogonalHeight ) : float
screenY float
zPosition float
overridingOrthogonal bool
overridingOrthogonalHeight float
Результат float

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

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

public Color BackgroundColor
Результат Color

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

Whether or not this camera should be drawn to the screen
public bool DrawToScreen
Результат bool

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

Defines the rendering order for this camera
public List RenderOrder
Результат List

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

public Vector3 UpVector
Результат Vector3