Class TCastleOrthographic
Unit
Declaration
type TCastleOrthographic = class(TComponent)
Description
Subcomponent used in TCastleCamera.Orthographic to set orthographic projection parameters.
Do not create instances of this class yourself, these are automatically created by TCastleCamera.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleOrthographic
Overview
Methods
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
procedure InternalSetEffectiveSize(const W, H: Single); |
Properties
![]() |
property Origin: TVector2 read FOrigin write SetOrigin; |
![]() |
property EffectiveWidth: Single read FEffectiveWidth; |
![]() |
property EffectiveHeight: Single read FEffectiveHeight; |
![]() |
property Width: Single read FWidth write SetWidth default 0; |
![]() |
property Height: Single read FHeight write SetHeight default 0; |
![]() |
property Scale: Single read FScale write SetScale default 1; |
![]() |
property OriginPersistent: TCastleVector2Persistent read FOriginPersistent ; |
Description
Methods
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
procedure InternalSetEffectiveSize(const W, H: Single); |
Properties
![]() |
property Origin: TVector2 read FOrigin write SetOrigin; |
|
Additional translation of the camera. The camera movement applied here is always scaled by the calculated orthographic projection width and height. By default this equals (0,0) which means that TCastleCamera.Position determines what is visible in the left-bottom corner of the viewport. This matches the typical 2D drawing coordinates used throughout our engine. In other words, if the camera is at position (0,0,whatever), then the (0,0) position in 2D is in the left-bottom corner of the TCastleViewport. You can change it e.g. to (0.5,0.5) to move the camera to the middle of the viewport. In effect, if the camera is at position (0,0,whatever), then the (0,0) position is in the center of the TCastleViewport. Both values of
| |
![]() |
property EffectiveWidth: Single read FEffectiveWidth; |
|
Currently used projection width and height, calculated following the algorithm described at Width and Height. | |
![]() |
property EffectiveHeight: Single read FEffectiveHeight; |
![]() |
property Width: Single read FWidth write SetWidth default 0; |
|
Orthographic projection width and height. You can leave one or both of them as zero (default) to automatically calculate effective projection width and height (in EffectiveWidth and EffectiveHeight):
In alll cases, the resulting size is also multiplied by Scale, by default 1.0. In all cases, you can read EffectiveWidth and EffectiveHeight to know the actual projection width and height, calculated using the above algorithm. | |
![]() |
property Height: Single read FHeight write SetHeight default 0; |
![]() |
property Scale: Single read FScale write SetScale default 1; |
|
Scales the projection size derived from Width and Height. The effect of this scale is also affected by the Origin. When Origin is zero, this behaves like scaling around left-botttom corner of the viewport. When Origin is (0.5,0.5), this behaves like scaling around the middle of the viewport. | |
![]() |
property OriginPersistent: TCastleVector2Persistent read FOriginPersistent ; |
|
Origin that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write Origin directly. See also
| |
Generated by PasDoc 0.16.0.

