Class TSerializationProcessColorsHelper

Unit

Declaration

type TSerializationProcessColorsHelper = class helper(TSerializationProcessVectorsHelper) for TSerializationProcess

Description

Helper methods you can use from TCastleComponent.CustomSerialization to manage reading/writing of colors.

Hierarchy

Overview

Methods

Public procedure ReadWriteColor(const Key: String; var Value: TCastleColor; const DefaultValue: TCastleColor; const IsStored: Boolean); overload;
Public procedure ReadWriteColor(const Key: String; var Value: TCastleColorRGB; const DefaultValue: TCastleColorRGB; const IsStored: Boolean); overload;

Description

Methods

Public procedure ReadWriteColor(const Key: String; var Value: TCastleColor; const DefaultValue: TCastleColor; const IsStored: Boolean); overload;

Serialize and deserialize given color Value.

When deserializing, we always try to read it from file. If it is not present, the Value is not modified. If it is present in the file, but not all components, then the not present componens are not modified (they are not reset to DefaultValue! The DefaultValue is only used at writing).

When serializing, we write it to file only if IsStored. Generally IsStored=false should indicate "the Value is the same as when the object is created, thus there's no point in serializing it". Moreover, each color component (Value.X, Value.Y...) is written only if it is different than corresponding DefaultValue color component (DefaultValue.X, DefaultValue.Y...).

Public procedure ReadWriteColor(const Key: String; var Value: TCastleColorRGB; const DefaultValue: TCastleColorRGB; const IsStored: Boolean); overload;
 

Generated by PasDoc 0.16.0.