Spout.receiver:receiveTexture: Difference between revisions
Created page with "__NOTOC__ '''Available since:''' Gideros 2019.5<br/> '''Class:''' Spout<br/> === Description === Copies the sender's current frame into a texture. Call it once per frame...." |
No edit summary |
||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
'''Available since:''' Gideros | '''Available since:''' Gideros 2018.6.3<br/> | ||
'''Class:''' [[Spout]]<br/> | '''Class:''' [[Spout]]<br/> | ||
Latest revision as of 00:53, 13 November 2026
Available since: Gideros 2018.6.3
Class: Spout
Description
Copies the sender's current frame into a texture. Call it once per frame.
(bool), (string), (number), (number) = receiver:receiveTexture(texture, name)
Call it from Event.ENTER_FRAME. A frame is only copied when the name, the size and the format match the sender the receiver is already connected to.
When the sender appears, changes name, changes size or changes format, Spout re-initialises and this call returns true without copying a frame, reporting the new name and size so the caller can adjust its texture.
Always store the returned name and rebuild the receiving texture when the size changes, otherwise the picture stays frozen while the call keeps succeeding.
Parameters
texture: (TextureBase) the texture the frame is copied into, usually a RenderTarget. It must be the sender's size
name: (string) the sender to receive from, normally the name returned by the previous call
Return values
Returns (boolean) true when the receiver is connected to a sender
Returns (string) the name of the connected sender
Returns (number) the sender width
Returns (number) the sender height