Class TCastleColorRGBPersistent

Unit

Declaration

type TCastleColorRGBPersistent = class(TCastleComponent)

Description

TCastleColorRGB record represented as a TPersistent descendant, to be able to visually edit it (in Lazarus and Delphi visual designer, and Castle Game Engine visual designer) and to serialize it.

Normal user code does not need to deal with this class or it's instances. Instead directly operate on TCastleColorRGB values, which is faster and more natural. TCastleColorRGB are simple records, so they are naturally copied on assignment, and various operators like additions work in a natural way too.

Source: src/base/castlecolors_persistent.inc (line 32).

Hierarchy

Overview

Fields

Public InternalGetValue: TGetVector3Event;
Public InternalSetValue: TSetVector3Event;
Public InternalDefaultValue: TCastleColorRGB;

Methods

Protected procedure Loaded; override;
Public constructor Create(const AOwner: TComponent = nil); reintroduce;
Public function ValueIsStreamed: Boolean; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;
Public function ToString: String; override;

Properties

Public property Value: TCastleColorRGB read GetValue write SetValue;
Published property Red: Single read GetRed write SetRed stored RedIsStored nodefault;
Published property Green: Single read GetGreen write SetGreen stored GreenIsStored nodefault;
Published property Blue: Single read GetBlue write SetBlue stored BlueIsStored nodefault;

Description

Fields

Public InternalGetValue: TGetVector3Event;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 58).

Public InternalSetValue: TSetVector3Event;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 59).

Public InternalDefaultValue: TCastleColorRGB;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 60).

Methods

Protected procedure Loaded; override;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 56).

Public constructor Create(const AOwner: TComponent = nil); reintroduce;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 61).

Public function ValueIsStreamed: Boolean; override;

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

Whether the current value of this object should be written to the stream. This should be True if anything inside this object should be serialized (which means it has non-default value or "stored" specifier indicates that it should be serialized).

This is used by CastleComponentSerialize, which is used in Castle Game Engine for all serialization.

In simple cases, this just says whether the current value of this object equals to some default value.

The default implementation of this class returns True (so always write).

Descendants that override this to sometimes return False (so no need to write) must be very careful: any addition of a new field requires extending this method, otherwise new field may not be saved sometimes (when all other fields are default). Descentants of such classes must also be aware of it. This check must include everything that is inside this object in JSON, including subcomponents and children objects (as done e.g. by TSerializationProcess.ReadWriteList). In practice, overriding this method is only reasonable for simple classes that will not change much in the future, like TCastleVector3Persistent.

The name of this method is consistent with TPropertyEditor.ValueIsStreamed in LCL.

Source: src/base/castlecolors_persistent.inc (line 63).

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.

Source: src/base/castlecolors_persistent.inc (line 64).

Public function ToString: String; override;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 65).

Properties

Public property Value: TCastleColorRGB read GetValue write SetValue;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 62).

Published property Red: Single read GetRed write SetRed stored RedIsStored nodefault;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 67).

Published property Green: Single read GetGreen write SetGreen stored GreenIsStored nodefault;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 68).

Published property Blue: Single read GetBlue write SetBlue stored BlueIsStored nodefault;

This item has no description.

Source: src/base/castlecolors_persistent.inc (line 69).


Generated by PasDoc 0.17.0.snapshot.