Class TCastleCrosshair

Unit

Declaration

type TCastleCrosshair = class(TCastleUserInterface)

Description

Display a simple crosshair in the middle of the parent control.

Hierarchy

Overview

Fields

Public nested const DefaultSize = 16.0;

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure Render; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;

Properties

Public property Color: TCastleColor read FColor write SetColor;
Published property Shape: TCastleCrosshairShape read FShape write SetShape default csCross;
Published property HorizontalAnchorSelf default hpMiddle;
Published property HorizontalAnchorParent default hpMiddle;
Published property VerticalAnchorSelf default vpMiddle;
Published property VerticalAnchorParent default vpMiddle;
Published property Width default DefaultSize;
Published property Height default DefaultSize;
Published property ColorPersistent: TCastleColorPersistent read FColorPersistent ;

Description

Fields

Public nested const DefaultSize = 16.0;

This item has no description.

Methods

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public procedure Render; override;

This item has no description. Showing description inherited from TCastleUserInterface.Render.

Render a control. Called only when Exists and GLInitialized, you can depend on it in the implementation of this method.

Do not explicitly call this method. Instead, render controls by adding them to the TCastleContainer.Controls list, or render them explicitly (for off-screen rendering) by TCastleContainer.RenderControl. This is method should only be overridden in your own code.

Before calling this method we always set some OpenGL state, and you can depend on it (and you can carelessly change it, as it will be reset again before rendering other control).

OpenGL state always set:

  • Viewport is set to include whole container.

  • Depth test is off.

  • (For fixed-function pipeline:) The 2D orthographic projection is always set at the beginning. Useful for 2D controls, 3D controls can just override projection matrix, e.g. use CastleRenderContext.PerspectiveProjection.

  • (For fixed-function pipeline:) The modelview matrix is set to identity. The matrix mode is always modelview.

  • (For fixed-function pipeline:) The raster position is set to (0,0). The (deprecated) WindowPos is also set to (0,0).

  • (For fixed-function pipeline:) Texturing, lighting, fog is off.

Beware that GLSL RenderContext.CurrentProgram has undefined value when this is called. You should always set it, before making direct OpenGL drawing calls (all the engine drawing routines of course do it already, this is only a concern if you make direct OpenGL / OpenGLES calls).

Public function PropertySections(const PropertyName: String): TPropertySections; override;

This item has no description. Showing description inherited from TCastleComponent.PropertySections.

Section where to show property in the editor.

Properties

Public property Color: TCastleColor read FColor write SetColor;

Color tint of the crosshair. This simply multiplies the crosshair RGBA image. By default this is opaque white.

Published property Shape: TCastleCrosshairShape read FShape write SetShape default csCross;

This item has no description.

Published property HorizontalAnchorSelf default hpMiddle;

By default, crosshair is centered.

Published property HorizontalAnchorParent default hpMiddle;

This item has no description. Showing description inherited from TCastleUserInterface.HorizontalAnchorParent.

Which parent border is aligned to our HorizontalAnchorSelf border.

Published property VerticalAnchorSelf default vpMiddle;

This item has no description. Showing description inherited from TCastleUserInterface.VerticalAnchorSelf.

Which our border to align with parent.

Published property VerticalAnchorParent default vpMiddle;

This item has no description. Showing description inherited from TCastleUserInterface.VerticalAnchorParent.

Which parent border is aligned to our VerticalAnchorSelf border.

Published property Width default DefaultSize;

This item has no description. Showing description inherited from TCastleUserInterface.Width.

These properties determine the control size. See the EffectiveRect documentation for details how the size is calculated.

Published property Height default DefaultSize;

This item has no description.

Published property ColorPersistent: TCastleColorPersistent read FColorPersistent ;

Color 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 Color directly.

See also
Color
Color tint of the crosshair.

Generated by PasDoc 0.16.0.