C# Class FlatRedBall.Camera

Inheritance: FlatRedBall.PositionedObject
Afficher le fichier Open project: vchelaru/FlatRedBall Class Usage Examples

Méthodes publiques

Свойство Type Description
BackgroundColor Color
DrawToScreen bool
RenderOrder List
UpVector Vector3

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
Color ( ) : System
GetWorldXGivenHorizontalPercentage ( float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth, float horizontalPercentage ) : float

Method Details

AbsoluteBottomYEdgeAt() public méthode

public AbsoluteBottomYEdgeAt ( float absoluteZ ) : float
absoluteZ float
Résultat float

AbsoluteLeftXEdgeAt() public méthode

public AbsoluteLeftXEdgeAt ( float absoluteZ ) : float
absoluteZ float
Résultat float

AbsoluteRightXEdgeAt() public méthode

public AbsoluteRightXEdgeAt ( float absoluteZ ) : float
absoluteZ float
Résultat float

AbsoluteTopYEdgeAt() public méthode

public AbsoluteTopYEdgeAt ( float absoluteZ ) : float
absoluteZ float
Résultat float

FixAspectRatioXConstant() public méthode

public FixAspectRatioXConstant ( ) : void
Résultat void

FixAspectRatioYConstant() public méthode

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
Résultat void

GetZDistanceForPixelPerfect() public méthode

public GetZDistanceForPixelPerfect ( ) : float
Résultat float

IsPointInView() public méthode

public IsPointInView ( double x, double y, double absoluteZ ) : bool
x double
y double
absoluteZ double
Résultat bool

IsSpriteInView() public méthode

public IsSpriteInView ( Sprite sprite ) : bool
sprite Sprite
Résultat bool

IsSpriteInView() public méthode

public IsSpriteInView ( Sprite sprite, bool relativeToCamera ) : bool
sprite Sprite
relativeToCamera bool
Résultat bool

IsTextInView() public méthode

public IsTextInView ( Text text ) : bool
text Text
Résultat bool

IsXInView() public méthode

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.
Résultat bool

IsYInView() public méthode

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.
Résultat bool

PixelsPerUnitAt() public méthode

public PixelsPerUnitAt ( Vector3 &absolutePosition ) : float
absolutePosition Vector3
Résultat float

PixelsPerUnitAt() public méthode

public PixelsPerUnitAt ( Vector3 &absolutePosition, float fieldOfView, bool orthogonal, float orthogonalHeight ) : float
absolutePosition Vector3
fieldOfView float
orthogonal bool
orthogonalHeight float
Résultat float

PixelsPerUnitAt() public méthode

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.
Résultat float

RelativeXEdgeAt() public méthode

public RelativeXEdgeAt ( float absoluteZ ) : float
absoluteZ float
Résultat float

RelativeXEdgeAt() public méthode

public RelativeXEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalWidth ) : float
absoluteZ float
fieldOfView float
aspectRatio float
orthogonal bool
orthogonalWidth float
Résultat float

RelativeYEdgeAt() public méthode

public RelativeYEdgeAt ( float absoluteZ ) : float
absoluteZ float
Résultat float

RelativeYEdgeAt() public méthode

public RelativeYEdgeAt ( float absoluteZ, float fieldOfView, float aspectRatio, bool orthogonal, float orthogonalHeight ) : float
absoluteZ float
fieldOfView float
aspectRatio float
orthogonal bool
orthogonalHeight float
Résultat float

UsePixelCoordinates() public méthode

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.
Résultat void

UsePixelCoordinates3D() public méthode

public UsePixelCoordinates3D ( float zToMakePixelPerfect ) : void
zToMakePixelPerfect float
Résultat void

WorldXAt() public méthode

public WorldXAt ( float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth, float screenX ) : float
zPosition float
overridingOrthogonal bool
overridingOrthogonalWidth float
screenX float
Résultat float

WorldXAt() public méthode

public WorldXAt ( float screenX, float zPosition ) : float
screenX float
zPosition float
Résultat float

WorldXAt() public méthode

public WorldXAt ( float screenX, float zPosition, Layer layer ) : float
screenX float
zPosition float
layer Layer
Résultat float

WorldXAt() public méthode

public WorldXAt ( float screenX, float zPosition, bool overridingOrthogonal, float overridingOrthogonalWidth ) : float
screenX float
zPosition float
overridingOrthogonal bool
overridingOrthogonalWidth float
Résultat float

WorldYAt() public méthode

public WorldYAt ( float zPosition, bool orthogonal, float orthogonalHeight, float screenY ) : float
zPosition float
orthogonal bool
orthogonalHeight float
screenY float
Résultat float

WorldYAt() public méthode

public WorldYAt ( float screenY, float zPosition ) : float
screenY float
zPosition float
Résultat float

WorldYAt() public méthode

public WorldYAt ( float screenY, float zPosition, Layer layer ) : float
screenY float
zPosition float
layer Layer
Résultat float

WorldYAt() public méthode

public WorldYAt ( float screenY, float zPosition, bool overridingOrthogonal, float overridingOrthogonalHeight ) : float
screenY float
zPosition float
overridingOrthogonal bool
overridingOrthogonalHeight float
Résultat float

Property Details

BackgroundColor public_oe property

public Color BackgroundColor
Résultat Color

DrawToScreen public_oe property

Whether or not this camera should be drawn to the screen
public bool DrawToScreen
Résultat bool

RenderOrder public_oe property

Defines the rendering order for this camera
public List RenderOrder
Résultat List

UpVector public_oe property

public Vector3 UpVector
Résultat Vector3