Class TCastleTransformDesign

Unit

Declaration

type TCastleTransformDesign = class(TCastleTransform)

Description

Contents are loaded from an indicated castle-transform file (by the Url property).

The file should be in the format created by Castle Game Engine Editor (serialized by CastleComponentSerialize routines) with .castle-transform extension.

Source: transform/castletransform_design.inc (line 28).

Hierarchy

Overview

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;
Public procedure BeforeDestruction; override;
Public function DesignedComponent(const ComponentName: String; const Required: Boolean = true): TComponent;
Public function FindRequiredComponent(const ComponentName: String): TComponent; deprecated 'use DesignedComponent(ComponentName)';
Public function FindComponent(const ComponentName: String): TComponent; deprecated 'use DesignedComponent(ComponentName, false)';
Public procedure ReloadUrl;

Properties

Public property DesignRoot: TCastleTransform read FDesign;
Published property Url: String read FUrl write SetUrl;
Published property RevertUrl: String read FRevertUrl write FRevertUrl;

Description

Methods

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Source: transform/castletransform_design.inc (line 50).

Public destructor Destroy; override;

This item has no description.

Source: transform/castletransform_design.inc (line 51).

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: transform/castletransform_design.inc (line 52).

Public procedure BeforeDestruction; override;

This item has no description.

Source: transform/castletransform_design.inc (line 53).

Public function DesignedComponent(const ComponentName: String; const Required: Boolean = true): TComponent;

Find by name a component in currently loaded design. When the name is not found, raises exception (unless Required is False, then it returns Nil).

Source: transform/castletransform_design.inc (line 58).

Public function FindRequiredComponent(const ComponentName: String): TComponent; deprecated 'use DesignedComponent(ComponentName)';

Warning: this symbol is deprecated: use DesignedComponent(ComponentName)

This item has no description.

Source: transform/castletransform_design.inc (line 61).

Public function FindComponent(const ComponentName: String): TComponent; deprecated 'use DesignedComponent(ComponentName, false)';

Warning: this symbol is deprecated: use DesignedComponent(ComponentName, false)

This item has no description.

Source: transform/castletransform_design.inc (line 62).

Public procedure ReloadUrl;

Load again the design from Url. This makes sense to be used when underlying file on disk changed, and you want to reload it.

Source: transform/castletransform_design.inc (line 67).

Properties

Public property DesignRoot: TCastleTransform read FDesign;

Root of the loaded components, or Nil if nothing was loaded yet.

Source: transform/castletransform_design.inc (line 70).

Published property Url: String read FUrl write SetUrl;

Load file with the transform design. The file should be in the format created by Castle Game Engine Editor (see CastleComponentSerialize unit) with .castle-transform extension. Setting this property automatically unloads the previous design, and loads a new one (if the value is <> '').

After loading a design, you can use DesignedComponent to find the components inside. So e.g. this works:

var
  MyDesign: TCastleTransformDesign;
  MyScene: TCastleScene;
begin
  MyDesign := TCastleTransformDesign.Create(...);
  MyDesign.Url := 'castle-data:/my_transform.castle-transform';
  MyScene := MyDesign.DesignedComponent('MyScene') as TCastleScene;
  MyScene.Translation := Vector3(1, 2, 3);
end;

Source: transform/castletransform_design.inc (line 94).

Published property RevertUrl: String read FRevertUrl write FRevertUrl;

URL used to perform editor "Revert" operation.

Source: transform/castletransform_design.inc (line 97).


Generated by PasDoc 0.17.0.snapshot.