Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PlayLooped()

SlotId Terraria.Audio.SoundPlayer.PlayLooped ( SoundStyle style,
Vector2 position,
ActiveSound::LoopedPlayCondition loopingCondition )
inline

Definition at line 28 of file SoundPlayer.cs.

29 {
30 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
31 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
32 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
33 if (Main.dedServ || style == null || !style.IsTrackable)
34 {
35 return SlotId.Invalid;
36 }
37 if (Vector2.DistanceSquared(Main.screenPosition + new Vector2(Main.screenWidth / 2, Main.screenHeight / 2), position) > 100000000f)
38 {
39 return SlotId.Invalid;
40 }
41 ActiveSound activeSound = new ActiveSound(style, position, loopingCondition);
43 }
void Add(TKey key, TValue value)
readonly SlotVector< ActiveSound > _trackedSounds
Definition SoundPlayer.cs:9
static float DistanceSquared(Vector2 value1, Vector2 value2)
Definition Vector2.cs:107
static readonly SlotId Invalid
Definition SlotId.cs:5

References Terraria.Audio.SoundPlayer._trackedSounds, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), Terraria.Main.dedServ, Microsoft.Xna.Framework.Vector2.DistanceSquared(), ReLogic.Utilities.SlotId.Invalid, Terraria.Audio.SoundStyle.IsTrackable, Terraria.Main.screenHeight, Terraria.Main.screenPosition, and Terraria.Main.screenWidth.

Referenced by Terraria.Audio.SoundEngine.PlayTrackedLoopedSound().