Unit CastleRectangles

Description

Rectangle representation (TRectangle, TFloatRectangle).

Uses

Overview

Classes, Interfaces, Objects and Records

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

Functions and Procedures

function Rectangle(const Left, Bottom: Integer; const Width, Height: Cardinal): TRectangle; overload;
function Rectangle(const LeftBottom: TVector2Integer; const Width, Height: Cardinal): TRectangle; overload;
function FloatRectangle(const Left, Bottom, Width, Height: Single): TFloatRectangle; overload;
function FloatRectangle(const R: TRectangle): TFloatRectangle; overload;
function FloatRectangle(const LeftBottom: TVector2; const Width, Height: Single): TFloatRectangle; overload;

Types

THorizontalPosition = (...);
TVerticalPosition = (...);
PFloatRectangle = ˆTFloatRectangle;
TFloatRectangleArray = packed array [0..MaxInt div SizeOf(TFloatRectangle) - 1] of TFloatRectangle;
PFloatRectangleArray = ˆTFloatRectangleArray;
TFloatRectangleList = specialize TStructList<TFloatRectangle>;

Description

Functions and Procedures

function Rectangle(const Left, Bottom: Integer; const Width, Height: Cardinal): TRectangle; overload;
 
function Rectangle(const LeftBottom: TVector2Integer; const Width, Height: Cardinal): TRectangle; overload;
 
function FloatRectangle(const Left, Bottom, Width, Height: Single): TFloatRectangle; overload;
 
function FloatRectangle(const R: TRectangle): TFloatRectangle; overload;
 
function FloatRectangle(const LeftBottom: TVector2; const Width, Height: Single): TFloatRectangle; overload;
 

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;
 
TFloatRectangleArray = packed array [0..MaxInt div SizeOf(TFloatRectangle) - 1] of TFloatRectangle;
 
PFloatRectangleArray = ˆTFloatRectangleArray;
 
TFloatRectangleList = specialize TStructList<TFloatRectangle>;
 

Generated by PasDoc 0.15.0.