Difference between revisions of "Theora.new"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2017.10<br/> '''Class:''' Ogg<br/> === Description === Creates a new Theora source. <source lang="lua"> (object) = Theora.new(fil...")
 
 
(3 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Creates a new Theora source.
 
Creates a new Theora source.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(object) = Theora.new(file)
 
(object) = Theora.new(file)
</source>
+
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
Line 14: Line 14:
 
=== Return values ===
 
=== Return values ===
 
'''Returns''' (object) the object to use as a source<br/>
 
'''Returns''' (object) the object to use as a source<br/>
 +
 +
=== Example ===
 +
'''A Video Sprite'''
 +
<syntaxhighlight lang="lua">
 +
Theora = require "Theora"
 +
local videoSource = Theora.new("videos/file_example_OGG_480_1_7mg.ogg")
 +
local videoStream = videoSource:play()
 +
local videoSprite = videoStream:getVideo()
 +
videoSprite:setPosition(0, 64)
 +
stage:addChild(videoSprite)
 +
</syntaxhighlight>
  
 
{{Ogg}}
 
{{Ogg}}

Latest revision as of 04:25, 26 August 2024

Available since: Gideros 2017.10
Class: Ogg

Description

Creates a new Theora source.

(object) = Theora.new(file)

Parameters

file: (string) path to the Theora file

Return values

Returns (object) the object to use as a source

Example

A Video Sprite

Theora = require "Theora"
local videoSource = Theora.new("videos/file_example_OGG_480_1_7mg.ogg")
local videoStream = videoSource:play()
local videoSprite = videoStream:getVideo()
videoSprite:setPosition(0, 64)
stage:addChild(videoSprite)