Click or drag to resize

Theme Class

A collection of ambient sounds and/or music to play.
Inheritance Hierarchy
SystemObject
  Mannequin.BindingsTheme

Namespace:  Mannequin.Bindings
Assembly:  Collapse (in Collapse.exe) Version: 0.4.6.1290 (0.4.6.1290)
Syntax
C#
public class Theme

The Theme type exposes the following members.

Constructors
  NameDescription
Public methodTheme
Create a new Theme
Top
Properties
  NameDescription
Public propertyName
The name of this Theme
Public propertyRepeatMusic
Should the music repeat itself?
Public propertyRepeatSFX
Sound the SFX repeat itself?
Top
Methods
  NameDescription
Public methodAddContinuousSFX
Add continuous SFX (i.e. ambient noise) to this Theme.
Public methodAddMusic
Add music to this Theme.
Public methodStart
Start this Theme, playing the contained music and/or sounds. This will stop the current theme.
Public methodStop
Stop this Theme and its contained music and/or sounds.
Top
Examples
Play a specific music track when the game starts.
Mannequin:Import("Content")
Mannequin:Import("Theme")
Mannequin:Import("Event")

local theme = nil

Event.On("ContentReady", function()
    local music = Content.GetSong("music/music10")

    theme = Theme()
    theme:AddMusic(music)
    theme.RepeatMusic = true
end)

Event.On("Game", function()
    theme:Start(false)
end)
See Also