Unit CastleRectangles

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

Rectangle representation (TRectangle, TFloatRectangle).

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Object TRectangle 2D rectangle with integer coordinates.
Object TFloatRectangle 2D rectangle with float coordinates.
Class TRectangleList  

Functions and Procedures

function Rectangle(const Left, Bottom: Integer; const Width, Height: Cardinal): TRectangle;
function Rectangle(const LeftBottom: TVector2Integer; const Width, Height: Cardinal): TRectangle;
function FloatRectangle(const Left, Bottom, Width, Height: Single): TFloatRectangle;
function FloatRectangle(const R: TRectangle): TFloatRectangle;
function FloatRectangle(const LeftBottom: TVector2Single; const Width, Height: Single): TFloatRectangle;
operator + (const R1, R2: TRectangle): TRectangle;
operator + (const R1, R2: TFloatRectangle): TFloatRectangle;
operator * (const R1, R2: TRectangle): TRectangle;
operator * (const R1, R2: TFloatRectangle): TFloatRectangle;

Types

THorizontalPosition = (...);
TVerticalPosition = (...);
PFloatRectangle = ˆTFloatRectangle;
TFloatRectangleList = specialize TGenericStructList<TFloatRectangle>;

Description

Functions and Procedures

function Rectangle(const Left, Bottom: Integer; const Width, Height: Cardinal): TRectangle;
 
function Rectangle(const LeftBottom: TVector2Integer; const Width, Height: Cardinal): TRectangle;
 
function FloatRectangle(const Left, Bottom, Width, Height: Single): TFloatRectangle;
 
function FloatRectangle(const R: TRectangle): TFloatRectangle;
 
function FloatRectangle(const LeftBottom: TVector2Single; const Width, Height: Single): TFloatRectangle;
 
operator + (const R1, R2: TRectangle): TRectangle;

Sum of the two rectangles is a bounding rectangle - a smallest rectangle that contains them both.

operator + (const R1, R2: TFloatRectangle): TFloatRectangle;
 
operator * (const R1, R2: TRectangle): TRectangle;

Common part of the two rectangles.

operator * (const R1, R2: TFloatRectangle): TFloatRectangle;
 

Types

THorizontalPosition = (...);

Horizontal position of one control/rectangle with respect to another.

This is used by TUIControl.Align and TRectangle.Align to specify the alignment of one control/rectangle with respect to another. In case of TUIControl.Align, this specifies the align of control with respect to the container (TCastleWindow or TCastleControl).

This is used to talk about position of the control and the container.

  1. When we talk about the position of the control (for example ControlPosition for TUIControl.Align), it determines which border of the control to align.

  2. When we talk about the position of the container (for example ContainerPosition for TUIControl.Align), this specifies the container border.

In most cases you use equal both control and container borders. For example, both ControlPosition and ContainerPosition are usually equal for TUIControlPos.Align call. This allows to align left control edge to left container edge, or right control edge to right container edge, or to center control within the container — which is the most common usage.

  • If both are hpLeft, then X specifies position of left control border relative to left container border. X should be >= 0 if you want to see the control completely within the container.

  • If both are hpMiddle, then X (most often just 0) specifies the shift between container middle to control middle. If X is zero, then control is just in the middle of the container.

  • If both are hpRight, then X specifies position of right control border relative to right container border. X should be <= 0 if you want to see the control completely within the container.

See also
TVerticalPosition
Vertical position of one control/rectangle with respect to another.
Values
  • hpLeft:  
  • hpMiddle:  
  • hpRight:  
TVerticalPosition = (...);

Vertical position of one control/rectangle with respect to another.

See also
THorizontalPosition
Horizontal position of one control/rectangle with respect to another.
Values
  • vpBottom:  
  • vpMiddle:  
  • vpTop:  
PFloatRectangle = ˆTFloatRectangle;
 
TFloatRectangleList = specialize TGenericStructList<TFloatRectangle>;
 

Generated by PasDoc 0.14.0.