Difference between revisions of "love.graphics.newVideo"
(Created page) |
m |
||
Line 5: | Line 5: | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | video = love.graphics.newVideo( filename ) | + | video = love.graphics.newVideo( filename, loadaudio ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
{{param|string|filename|The file path to the Ogg Theora video file.}} | {{param|string|filename|The file path to the Ogg Theora video file.}} | ||
+ | {{param|boolean|loadaudio (nil)|Whether to try to load the video's audio into an audio [[Source]]. If not explicitly set to true or false, it will try without causing an error if the video has no audio.}} | ||
=== Returns === | === Returns === | ||
{{param|Video|video|A new Video.}} | {{param|Video|video|A new Video.}} | ||
Line 15: | Line 16: | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | video = love.graphics.newVideo( videostream ) | + | video = love.graphics.newVideo( videostream, loadaudio ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
{{param|VideoStream|videostream|A video stream object.}} | {{param|VideoStream|videostream|A video stream object.}} | ||
+ | {{param|boolean|loadaudio (nil)|Whether to try to load the video's audio into an audio [[Source]]. If not explicitly set to true or false, it will try without causing an error if the video has no audio.}} | ||
=== Returns === | === Returns === | ||
{{param|Video|video|A new Video.}} | {{param|Video|video|A new Video.}} |
Revision as of 01:59, 14 December 2015
Available since LÖVE 0.10.0 |
This function is not supported in earlier versions. |
Creates a new drawable Video. Currently only Ogg Theora video files are supported.
This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused! |
Contents
Function
Synopsis
video = love.graphics.newVideo( filename, loadaudio )
Arguments
string filename
- The file path to the Ogg Theora video file.
boolean loadaudio (nil)
- Whether to try to load the video's audio into an audio Source. If not explicitly set to true or false, it will try without causing an error if the video has no audio.
Returns
Video video
- A new Video.
Function
Synopsis
video = love.graphics.newVideo( videostream, loadaudio )
Arguments
VideoStream videostream
- A video stream object.
boolean loadaudio (nil)
- Whether to try to load the video's audio into an audio Source. If not explicitly set to true or false, it will try without causing an error if the video has no audio.
Returns
Video video
- A new Video.
Examples
Load and play a video.
function love.load()
video = love.graphics.newVideo("myvideo.ogv")
video:play()
end
function love.draw()
love.graphics.draw(video, 0, 0)
end
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info