Class Theme
A collection of ambient sounds and/or music to play.
Inheritance
System.Object
Theme
Namespace: Mannequin.Bindings
Assembly: Collapse.dll
Syntax
public class Theme : object
Examples
Play a specific music track when the game starts.
Mannequin:Import("Theme")
Mannequin:Import("Event")
Mannequin:Import("Song")
local theme = nil
Event.On("ContentReady", function()
local music = Song("music/music10")
theme = Theme()
theme:AddMusic(music)
theme.RepeatMusic = true
end)
Event.On("Game", function()
theme:Start(false)
end)
Constructors
Theme()
Create a new Theme
Declaration
public Theme()
Theme(String)
Get a theme based on JSON data.
Declaration
public Theme(string loc = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | loc | The location of the Theme to import (or empty to create a new one). NB: ModFS handles this. |
Properties
ContinuousEffectList
The list of "continuous effects" (i.e. sounds that play sporadically)
Declaration
public List<Sound> ContinuousEffectList { get; set; }
Property Value
Type | Description |
---|---|
List<Sound> |
ContinuousSFX
Sound effects that play continuously.
Declaration
public List<Sound> ContinuousSFX { get; }
Property Value
Type | Description |
---|---|
List<Sound> |
MusicList
The list of Songs in this Theme.
Declaration
public List<Song> MusicList { get; set; }
Property Value
Type | Description |
---|---|
List<Song> |
Name
The name of this Theme
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RepeatMusic
Should the music repeat itself?
Declaration
public bool RepeatMusic { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RepeatSFX
Sound the SFX repeat itself?
Declaration
public bool RepeatSFX { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddContinuousSFX(Sound)
Add continuous SFX (i.e. ambient noise) to this Theme.
Declaration
public void AddContinuousSFX(Sound sfx)
Parameters
Type | Name | Description |
---|---|---|
Sound | sfx | A Sound to play |
AddMusic(Song)
Add music to this Theme.
Declaration
public void AddMusic(Song song)
Parameters
Type | Name | Description |
---|---|---|
Song | song | A Song to add |
Start(Boolean)
Start this Theme, playing the contained music and/or sounds. This will stop the current theme.
Declaration
public void Start(bool shouldTransitionSmoothly)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | shouldTransitionSmoothly |
Stop(Boolean)
Stop this Theme and its contained music and/or sounds.
Declaration
public void Stop(bool shouldTransitionSmoothly)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | shouldTransitionSmoothly |