Class TCastleBackground
Unit
Declaration
type TCastleBackground = class(TCastleComponent)
Description
Background, a skybox with a color gradient to represent sky and ground behind.
See https://en.wikipedia.org/wiki/Cube_mapping#Skyboxes .
You can find numerous free skyboxes e.g. on https://opengameart.org/art-search?keys=skybox and http://www.humus.name/index.php?page=Textures .
Source: scene/castlescene_background.inc (line 27).
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleBackground
Overview
Constants
| Public | DefaultSmoothEquator = 0.025; |
Methods
| Protected | function GetInternalText: String; virtual; |
| Protected | procedure SetInternalText(const Value: String); virtual; |
| Protected | procedure SetName(const Value: TComponentName); override; |
| Protected | procedure TranslateProperties(const TranslatePropertyEvent: TTranslatePropertyEvent); virtual; |
| Public | destructor Destroy; override; |
| Public | procedure CustomSerialization(const SerializationProcess: TSerializationProcess); virtual; |
| Public | function PropertySections(const PropertyName: String): TPropertySections; virtual; |
| Public | procedure SetTransient; |
| Public | procedure AddNonVisualComponent(const NonVisualComponent: TComponent); |
| Public | procedure InsertNonVisualComponent(const Index: Integer; const NonVisualComponent: TComponent); |
| Public | procedure RemoveNonVisualComponent(const NonVisualComponent: TComponent); |
| Public | function NonVisualComponentsIndexOf(const NonVisualComponent: TComponent): Integer; |
| Public | function NonVisualComponentsCount: Integer; |
| Public | function NonVisualComponentsEnumerate: TNonVisualComponentsEnumerator; |
| Public | function ValueIsStreamed: Boolean; virtual; |
| Public | procedure DesignerInfo(const SList: TStrings); virtual; |
| Public | procedure DesignerWarnings(const SList: TStrings); virtual; |
| Protected | procedure Loaded; override; |
| Public | constructor Create(AOwner: TComponent); override; |
| Public | destructor Destroy; override; |
| Public | function PropertySections(const PropertyName: String): TPropertySections; override; |
| Public | procedure SetEffects(const Value: array of TEffectNode); |
Properties
| Public | property NonVisualComponents [const Index: Integer]: TComponent read GetNonVisualComponents; |
| Public | property IsLoading: Boolean read FIsLoading; |
| Public | property SkyTopColor: TCastleColorRGB read FSkyTopColor write SetSkyTopColor; |
| Public | property SkyEquatorColor: TCastleColorRGB read FSkyEquatorColor write SetSkyEquatorColor; |
| Public | property GroundBottomColor: TCastleColorRGB read FGroundBottomColor write SetGroundBottomColor; |
| Public | property GroundEquatorColor: TCastleColorRGB read FGroundEquatorColor write SetGroundEquatorColor; |
| Public | property Rotation: TVector4 read FRotation write SetRotation; |
| Published | property TextureNegativeZ: String read FTextureNegativeZ write SetTextureNegativeZ; |
| Published | property TexturePositiveZ: String read FTexturePositiveZ write SetTexturePositiveZ; |
| Published | property TexturePositiveY: String read FTexturePositiveY write SetTexturePositiveY; |
| Published | property TextureNegativeY: String read FTextureNegativeY write SetTextureNegativeY; |
| Published | property TextureNegativeX: String read FTextureNegativeX write SetTextureNegativeX; |
| Published | property TexturePositiveX: String read FTexturePositiveX write SetTexturePositiveX; |
| Published | property SmoothEquator: Single read FSmoothEquator write SetSmoothEquator default DefaultSmoothEquator; |
| Published | property SkyTopColorPersistent: TCastleColorRGBPersistent read FSkyTopColorPersistent ; |
| Published | property SkyEquatorColorPersistent: TCastleColorRGBPersistent read FSkyEquatorColorPersistent ; |
| Published | property GroundBottomColorPersistent: TCastleColorRGBPersistent read FGroundBottomColorPersistent ; |
| Published | property GroundEquatorColorPersistent: TCastleColorRGBPersistent read FGroundEquatorColorPersistent ; |
| Published | property RotationPersistent: TCastleVector4RotationPersistent read FRotationPersistent ; |
Description
Constants
| Public | DefaultSmoothEquator = 0.025; |
|
This item has no description. | |
Methods
| Protected | function GetInternalText: String; virtual; |
|
This item has no description. | |
| Protected | procedure SetInternalText(const Value: String); virtual; |
|
This item has no description. | |
| Protected | procedure SetName(const Value: TComponentName); override; |
|
This item has no description. | |
| Protected | procedure TranslateProperties(const TranslatePropertyEvent: TTranslatePropertyEvent); virtual; |
|
Enumerate all properties that are possible to translate in this component. E.g. in TCastleLabel it will return TCastleLabel.Caption, in TCastleEdit it will return TCastleEdit.Text and TCastleEdit.Placeholder. Returns only non-empty properties, thus assuming that if current (by convention, English) text is empty, then there is no point in translating it. Moreover descendants may define boolean properties to exclude particular text from translating, e.g. TCastleLabel.CaptionTranslate, TCastleEdit.TextTranslate, TCastleEdit.PlaceholderTranslate. It is not recursive (it doesn't enumerate children properties). Use global TranslateProperties procedure to call this on a hierarchy of TComponent. You usually don't want to call this method (it is called by other engine routines). But you may find it useful to override this, if you define new component. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Public | procedure CustomSerialization(const SerializationProcess: TSerializationProcess); virtual; |
|
Override this method to call various methods of SerializationProcess, which in turn allows to serialize/deserialize things that are not published. This allows to serialize/deserialize with more freedom, e.g. to serialize/deserialize some private field. | |
| Public | function PropertySections(const PropertyName: String): TPropertySections; virtual; |
|
Section where to show property in the editor. | |
| Public | procedure SetTransient; |
|
Ignore this component when serializing parent's TCastleUserInterface.Controls list or TCastleTransform.List, and do not show this component in CGE editor. This simply sets csTransient flag in ComponentStyle. This is useful for children that are automatically managed by the parent, and should not be modified by user code. For example, TCastleCheckbox is internally composed from TCastleImageControl and TCastleLabel children, but we don't want to serialize or even show these children to user. Note that if you want to prevent this component from serializing as part of TCastleUserInterface.Controls list or TCastleTransform.List, but you still want it to be visible in CGE editor, then make it a "subcomponent" instead, by Note that both csSubComponent and csTransient only disable the component serialization as part of parent's lists enumerated by CustomSerialization (see internal TCastleUserInterface.SerializeChildrenEnumerate , TCastleTransform.SerializeChildrenEnumerate, TCastleTransform.SerializeBehaviorsEnumerate). If you will make the component published in its own property (which is normal for "subcomponents") then it will be serialized anyway, just as part of it's own property (like TCastleScrollView.ScrollArea). So to really avoid serializing a children component make it csSubComponent and/or csTransient, and do not publish it. | |
| Public | procedure AddNonVisualComponent(const NonVisualComponent: TComponent); |
|
Add non-visual component to this component. This is used to organize non-visual components in a tree hierarchy, in CGE designs and editor.
See also
| |
| Public | procedure InsertNonVisualComponent(const Index: Integer; const NonVisualComponent: TComponent); |
|
Insert non-visual component to this component. This is used to organize non-visual components in a tree hierarchy, in CGE designs and editor.
See also
| |
| Public | procedure RemoveNonVisualComponent(const NonVisualComponent: TComponent); |
|
Removes the component previously added by AddNonVisualComponent. | |
| Public | function NonVisualComponentsIndexOf(const NonVisualComponent: TComponent): Integer; |
|
Index of the previously added non-visual component. Returns -1 if the component was not found. | |
| Public | function NonVisualComponentsCount: Integer; |
|
Count of components added by AddNonVisualComponent.
See also
| |
| Public | function NonVisualComponentsEnumerate: TNonVisualComponentsEnumerator; |
|
You can enumerate current non-visual components using loop like See also
| |
| Public | function ValueIsStreamed: Boolean; virtual; |
|
Whether the current value of this object should be written to the stream. This should be 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 Descendants that override this to sometimes return The name of this method is consistent with TPropertyEditor.ValueIsStreamed in LCL. | |
| Public | procedure DesignerInfo(const SList: TStrings); virtual; |
|
Override to add information that should be visible at design-time. Call | |
| Public | procedure DesignerWarnings(const SList: TStrings); virtual; |
|
Override to add warnings that should be visible at design-time. Call | |
| Protected | procedure Loaded; override; |
|
This item has no description. | |
| Public | constructor Create(AOwner: TComponent); override; |
|
This item has no description. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| 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 | procedure SetEffects(const Value: array of TEffectNode); |
|
Add shader effects to configure how is the background rendered. See https://castle-engine.io/shaders for documentation how shader effects work in Castle Game Engine. | |
Properties
| Public | property NonVisualComponents [const Index: Integer]: TComponent read GetNonVisualComponents; |
|
Components added by AddNonVisualComponent. | |
| Public | property IsLoading: Boolean read FIsLoading; |
|
Is the component during deserialization now. Note: We can't use | |
| Public | property SkyTopColor: TCastleColorRGB read FSkyTopColor write SetSkyTopColor; |
|
Sky color in the zenith. | |
| Public | property SkyEquatorColor: TCastleColorRGB read FSkyEquatorColor write SetSkyEquatorColor; |
|
Sky color at the equator. SkyTopColor and | |
| Public | property GroundBottomColor: TCastleColorRGB read FGroundBottomColor write SetGroundBottomColor; |
|
Ground color at nadir (direction looking straight down). | |
| Public | property GroundEquatorColor: TCastleColorRGB read FGroundEquatorColor write SetGroundEquatorColor; |
|
Ground color at equator. GroundBottomColor and | |
| Public | property Rotation: TVector4 read FRotation write SetRotation; |
|
Rotate the background around any axis easily. By default this is (0, 1, 0, 0) and often you will want to just change the 4th rotation component, angle, to rotate around the Y axis. Set it like this: MyBackground.Rotation := Vector4(0, 1, 0, Pi / 4); | |
| Published | property TextureNegativeZ: String read FTextureNegativeZ write SetTextureNegativeZ; |
|
Back (-Z) background texture. Orientation should match X3D Background node. | |
| Published | property TexturePositiveZ: String read FTexturePositiveZ write SetTexturePositiveZ; |
|
Front (+Z) background texture. Orientation should match X3D Background node. | |
| Published | property TexturePositiveY: String read FTexturePositiveY write SetTexturePositiveY; |
|
Top (+Y) background texture. Orientation should match X3D Background node. | |
| Published | property TextureNegativeY: String read FTextureNegativeY write SetTextureNegativeY; |
|
Bottom (-Y) background texture. Orientation should match X3D Background node. | |
| Published | property TextureNegativeX: String read FTextureNegativeX write SetTextureNegativeX; |
|
Left (-X) background texture. Orientation should match X3D Background node. | |
| Published | property TexturePositiveX: String read FTexturePositiveX write SetTexturePositiveX; |
|
Right (+X) background texture. Orientation should match X3D Background node. | |
| Published | property SmoothEquator: Single read FSmoothEquator write SetSmoothEquator default DefaultSmoothEquator; |
|
Make color transition from sky to ground less abrupt, adding a gradient from GroundEquatorColor to SkyEquatorColor. This property determines gradient size, in radians – angle along the sky sphere. | |
| Published | property SkyTopColorPersistent: TCastleColorRGBPersistent read FSkyTopColorPersistent ; |
|
SkyTopColor 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 SkyTopColor directly. See also
Source: scene/auto_generated_persistent_vectors/tcastlebackground_persistent_vectors.inc (line 37). | |
| Published | property SkyEquatorColorPersistent: TCastleColorRGBPersistent read FSkyEquatorColorPersistent ; |
|
SkyEquatorColor 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 SkyEquatorColor directly. See also
Source: scene/auto_generated_persistent_vectors/tcastlebackground_persistent_vectors.inc (line 105). | |
| Published | property GroundBottomColorPersistent: TCastleColorRGBPersistent read FGroundBottomColorPersistent ; |
|
GroundBottomColor 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 GroundBottomColor directly. See also
Source: scene/auto_generated_persistent_vectors/tcastlebackground_persistent_vectors.inc (line 173). | |
| Published | property GroundEquatorColorPersistent: TCastleColorRGBPersistent read FGroundEquatorColorPersistent ; |
|
GroundEquatorColor 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 GroundEquatorColor directly. See also
Source: scene/auto_generated_persistent_vectors/tcastlebackground_persistent_vectors.inc (line 241). | |
| Published | property RotationPersistent: TCastleVector4RotationPersistent read FRotationPersistent ; |
|
Rotation 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 Rotation directly. See also
Source: scene/auto_generated_persistent_vectors/tcastlebackground_persistent_vectors.inc (line 309). | |
Generated by PasDoc 0.17.0.snapshot.