Class TCastleSoundSource
Unit
Declaration
type TCastleSoundSource = class(TCastleBehavior)
Description
Behavior to play spatial sounds, that automatically follow the parent TCastleTransform transformation.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleBehavior
- TCastleSoundSource
Overview
Methods
![]() |
procedure ParentChanged; override; |
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
![]() |
procedure PlayOnce(const SoundType: TSoundType; const SoundHeight: Single; const TiedToParent: boolean = true); |
Properties
![]() |
property Sound: TCastleSound read FSound; |
Description
Methods
![]() |
procedure ParentChanged; override; |
![]() |
constructor Create(AOwner: TComponent); override; |
![]() |
destructor Destroy; override; |
![]() |
procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
![]() |
procedure PlayOnce(const SoundType: TSoundType; const SoundHeight: Single; const TiedToParent: boolean = true); |
|
Play SoundType where the parent is. The exact position is between Parent.Translation and Parent.Middle. SoundHeight = 0 means to use Parent.Translation, SoundHeight = 1 means Parent.Middle, other values imply a linear interpolation between the above two values. If TiedToParent then the sound position will be updated as the parent will move, and when we will be destroyed, sound will stop. If not TiedToParent, then the sound will simply be done at parent's position, but then it will continue to be played independent of the parent existence or position. | |
Properties
![]() |
property Sound: TCastleSound read FSound; |
|
Optional default sound to play here, looping. Note that this is not the only sound possible to play using this TCastleSoundSource. You can play any other TCastleSound instance, defined anywhere, by calling PlayOnce here. | |
Generated by PasDoc 0.16.0.


