Difference between revisions of "Source:setLooping"

(Added examples)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
 
Sets whether the Source should loop.
 
Sets whether the Source should loop.
 
== Function ==
 
== Function ==
Line 10: Line 9:
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
== Examples ==
 +
<source lang="lua">
 +
function love.load()
 +
    music = love.audio.newSource("music_loop.wav")
 +
 +
    music:setLooping(true)
 +
    music:play()
 +
    -- Music will now play forever, until stopped or paused.
 +
end
 +
</source>
 
== See Also ==
 
== See Also ==
 
* [[parent::Source]]
 
* [[parent::Source]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Sets whether the Source should loop.}}
 
{{#set:Description=Sets whether the Source should loop.}}
 +
{{#set:Since=000}}
 +
== Other Languages ==
 +
{{i18n|Source:setLooping}}

Latest revision as of 16:16, 3 November 2016

Sets whether the Source should loop.

Function

Synopsis

Source:setLooping( loop )

Arguments

boolean loop
True if the source should loop, false otherwise.

Returns

Nothing.

Examples

function love.load()
    music = love.audio.newSource("music_loop.wav")

    music:setLooping(true)
    music:play()
    -- Music will now play forever, until stopped or paused.
end

See Also


Other Languages