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.

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.

Public InternalSetValue: TSetVector3Event;

This item has no description.

Public InternalDefaultValue: TCastleColorRGB;

This item has no description.

Methods

Protected procedure Loaded; override;

This item has no description.

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

This item has no description.

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.

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.

Public function ToString: String; override;

This item has no description.

Properties

Public property Value: TCastleColorRGB read GetValue write SetValue;

This item has no description.

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

This item has no description.

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

This item has no description.

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

This item has no description.


Generated by PasDoc 0.16.0-snapshot.