Difference between revisions of "Source:clone"

(Created page)
 
m
 
Line 2: Line 2:
 
Creates an identical copy of the Source in the stopped state.
 
Creates an identical copy of the Source in the stopped state.
  
Static Sources will use significantly less memory if [[Source:clone]] is used to create them instead of [[love.audio.newSource]], so this method should be preferred when making multiple Sources which play the same sound.
+
Static Sources will use significantly less memory and take much less time to be created if [[Source:clone]] is used to create them instead of [[love.audio.newSource]], so this method should be preferred when making multiple Sources which play the same sound.
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===

Latest revision as of 12:16, 30 January 2014

Available since LÖVE 0.9.1
This function is not supported in earlier versions.

Creates an identical copy of the Source in the stopped state.

Static Sources will use significantly less memory and take much less time to be created if Source:clone is used to create them instead of love.audio.newSource, so this method should be preferred when making multiple Sources which play the same sound.

Function

Synopsis

source = Source:clone( )

Arguments

None.

Returns

Source source
The new identical copy of this Source.

Notes

Cloned Sources inherit all the set-able state of the original Source, but they are initialized stopped.

See Also

Other Languages