Difference between revisions of "RenderTarget.new"

From GiderosMobile
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2024.3<br/>
'''<translate>Available since</translate>:''' Gideros 2013.06<br/>
+
'''Class:''' [[RenderTarget]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/RenderTarget|RenderTarget]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate>Creates new RenderTarget object</translate>
+
Creates a new RenderTarget object (Gideros 2024.3+).
<source lang="lua">
+
<syntaxhighlight lang="lua">
RenderTarget.new(width,height,filtering,repeat,autoscale)
+
RenderTarget.new(width,height,filtering,options)
</source>
+
</syntaxhighlight>
=== <translate>Parameters</translate> ===
+
 
'''width''': (number) <translate>width of rendered texture</translate> <br/>
+
=== Parameters ===
'''height''': (number) <translate>height of rendered texture</translate> <br/>
+
'''width''': (''number'') width of rendered texture<br/>
'''filtering''': (boolean, default = false) <translate>Whether or not the texture is filtered.</translate> <br/>
+
'''height''': (''number'') height of rendered texture<br/>
'''repeat''': (boolean, default = false) <translate>Whether or not the texture is repeating.</translate> <br/>
+
'''filtering''': (''boolean'') set texture filtering, that is smoothing the image ('''default = false''')<br/>
'''autoscale''': (boolean, default = false) <translate>Whether or not the actual texture size should be scaled to match display resolution.</translate> <br/>
+
'''options''': now you can pass various options as a table:
 +
* '''wrap''': (''string'') either "clamp" or "repeating" ('''default = "clamp"''')<br/>
 +
* '''format''': (''string'') specify the wanted pixel format for this render target. Use ones of the [[TextureBase]] format constants, or leave nil for default ('''default = [[TextureBase.RGBA8888]]''')<br/>
 +
* '''pow2''': (''boolean'') extend the texture to a power of two size internally ('''default = true''')<br/>
 +
* '''filter''': (''boolean'') set texture filtering, that is smoothing the image ('''default = false''')<br/>
 +
 
 +
=== Example ===
 +
'''Gideros 2024.3+'''
 +
<syntaxhighlight lang="lua">
 +
local rt = RenderTarget.new(bmp:getWidth(), bmp:getHeight(), false, { pow2=false })
 +
</syntaxhighlight>
 +
 
 +
 
 +
----
 +
 
 +
 
 +
'''Available since:''' Gideros 2013.06<br/>
 +
'''Class:''' [[RenderTarget]]<br/>
 +
 
 +
=== Description ===
 +
Creates a new RenderTarget object.
 +
<syntaxhighlight lang="lua">
 +
RenderTarget.new(width,height,filtering,repeating,autoscale,depth,format,extend)
 +
</syntaxhighlight>
 +
 
 +
=== Parameters ===
 +
'''width''': (number) width of rendered texture<br/>
 +
'''height''': (number) height of rendered texture<br/>
 +
'''filtering''': (boolean) set texture filtering, that is smoothing the image ('''default = false''')<br/>
 +
'''repeating''': (boolean) set texture repeating ('''default = false''')<br/>
 +
'''autoscale''': (boolean) whether the actual texture size should be scaled to match display resolution ('''default = false''')<br/>
 +
'''depth''': (boolean) indicate this rendertarget will hold depth component. Setting this to true creates a render target suitable for shadow mapping ('''default = false''')<br/>
 +
'''format''': (string) specify the wanted pixel format for this render target. Use ones of the [[TextureBase]] format constants, or leave nil for default ('''default = [[TextureBase.RGBA8888]]''')<br/>
 +
'''extend''': (boolean) extend the texture to a power of two size internally '''since Gideros 2022.5.1''' ('''default = true''')<br/>
 +
 
 +
{{RenderTarget}}

Latest revision as of 13:27, 30 April 2024

Available since: Gideros 2024.3
Class: RenderTarget

Description

Creates a new RenderTarget object (Gideros 2024.3+).

RenderTarget.new(width,height,filtering,options)

Parameters

width: (number) width of rendered texture
height: (number) height of rendered texture
filtering: (boolean) set texture filtering, that is smoothing the image (default = false)
options: now you can pass various options as a table:

  • wrap: (string) either "clamp" or "repeating" (default = "clamp")
  • format: (string) specify the wanted pixel format for this render target. Use ones of the TextureBase format constants, or leave nil for default (default = TextureBase.RGBA8888)
  • pow2: (boolean) extend the texture to a power of two size internally (default = true)
  • filter: (boolean) set texture filtering, that is smoothing the image (default = false)

Example

Gideros 2024.3+

local rt = RenderTarget.new(bmp:getWidth(), bmp:getHeight(), false, { pow2=false })




Available since: Gideros 2013.06
Class: RenderTarget

Description

Creates a new RenderTarget object.

RenderTarget.new(width,height,filtering,repeating,autoscale,depth,format,extend)

Parameters

width: (number) width of rendered texture
height: (number) height of rendered texture
filtering: (boolean) set texture filtering, that is smoothing the image (default = false)
repeating: (boolean) set texture repeating (default = false)
autoscale: (boolean) whether the actual texture size should be scaled to match display resolution (default = false)
depth: (boolean) indicate this rendertarget will hold depth component. Setting this to true creates a render target suitable for shadow mapping (default = false)
format: (string) specify the wanted pixel format for this render target. Use ones of the TextureBase format constants, or leave nil for default (default = TextureBase.RGBA8888)
extend: (boolean) extend the texture to a power of two size internally since Gideros 2022.5.1 (default = true)