starling-framework
Version:
A fast, productive library for 2D cross-platform development.
701 lines • 177 kB
HTML
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>RenderTexture | starling-framework</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">starling-framework</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../index.html">starling</a>
</li>
<li>
<a href="../modules/starling.textures.html">textures</a>
</li>
<li>
<a href="starling.textures.rendertexture.html">RenderTexture</a>
</li>
</ul>
<h1>Class RenderTexture</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>A RenderTexture is a any texture onto which you can draw any display object.</p>
</div>
<p>After creating a render texture, just call the <code>draw</code> method to render
an object directly onto the texture. The object will be drawn onto the texture at its current
position, adhering its current rotation, scale and alpha properties.</p>
<p>Drawing is done very efficiently, as it is happening directly in graphics memory. After
you have drawn objects onto the texture, the performance will be just like that of a normal
texture — no matter how many objects you have drawn.</p>
<p>If you draw lots of objects at once, it is recommended to bundle the drawing calls in
a block via the <code>drawBundled</code> method, like shown below. That will speed it up
immensely, allowing you to draw hundreds of objects very quickly.</p>
<pre><code><span class="hljs-section"><pre></span>
</code></pre><p> renderTexture.drawBundled(function():void
{
for (i?:number; i<numDrawings; ++i)
{
image.rotation = (2 * Math.PI / numDrawings) * i;
renderTexture.draw(image);
}
});
</pre></p>
<p>To erase parts of a render texture, you can use any display object like a "rubber" by
setting its blending mode to <code>BlendMode.ERASE</code>. To wipe it completely clean,
use the <code>clear</code> method.</p>
<p> <strong>Persistence</strong></p>
<p>Older devices may require double buffering to support persistent render textures. Thus,
you should disable the <code>persistent</code> parameter in the constructor if you only
need to make one draw operation on the texture. The static <code>useDoubleBuffering</code>
property allows you to customize if new textures will be created with or without double
buffering.</p>
<p> <strong>Context Loss</strong></p>
<p>Unfortunately, render textures are wiped clean when the render context is lost.
This means that you need to manually recreate all their contents in such a case.
One way to do that is by using the <code>root.onRestore</code> callback, like here:</p>
<listing>
renderTexture.root.onRestore = function():void
{
quad:Quad = new Quad(100, 100, 0xff00ff);
renderTexture.clear(); // required on texture restoration
renderTexture.draw(quad);
});</listing>
<p>For example, a drawing app would need to store information about all draw operations
when they occur, and then recreate them inside <code>onRestore</code> on a context loss
(preferably using <code>drawBundled</code> instead).</p>
<p>However, there is one problem: when that callback is executed, it's very likely that
not all of your textures are already available, since they need to be restored, too (and
that might take a while). You probably loaded your textures with the "AssetManager".
In that case, you can listen to its <code>TEXTURES_RESTORED</code> event instead:</p>
<listing>
assetManager.addEventListener(Event.TEXTURES_RESTORED, function():void
{
brush:Image = new Image(assetManager.getTexture("brush"));
renderTexture.draw(brush);
});</listing>
<p>[Note that this time, there is no need to call <code>clear</code>, because that's the
default behavior of <code>onRestore</code>, anyway — and we didn't modify that.]</p>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<a href="starling.textures.subtexture.html" class="tsd-signature-type">SubTexture</a>
<ul class="tsd-hierarchy">
<li>
<span class="target">RenderTexture</span>
</li>
</ul>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section tsd-is-external">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite tsd-is-external"><a href="starling.textures.rendertexture.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section tsd-is-external">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#base" class="tsd-kind-icon">base</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#format" class="tsd-kind-icon">format</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#frame" class="tsd-kind-icon">frame</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#frameheight" class="tsd-kind-icon">frame<wbr>Height</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#framewidth" class="tsd-kind-icon">frame<wbr>Width</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#height" class="tsd-kind-icon">height</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-external"><a href="starling.textures.rendertexture.html#ispersistent" class="tsd-kind-icon">is<wbr>Persistent</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#mipmapping" class="tsd-kind-icon">mip<wbr>Mapping</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#nativeheight" class="tsd-kind-icon">native<wbr>Height</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#nativewidth" class="tsd-kind-icon">native<wbr>Width</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#ownsparent" class="tsd-kind-icon">owns<wbr>Parent</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#parent" class="tsd-kind-icon">parent</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#premultipliedalpha" class="tsd-kind-icon">premultiplied<wbr>Alpha</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#region" class="tsd-kind-icon">region</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#root" class="tsd-kind-icon">root</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#rotated" class="tsd-kind-icon">rotated</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#scale" class="tsd-kind-icon">scale</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#transformationmatrix" class="tsd-kind-icon">transformation<wbr>Matrix</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#transformationmatrixtoroot" class="tsd-kind-icon">transformation<wbr>Matrix<wbr>ToRoot</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#width" class="tsd-kind-icon">width</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#asyncbitmapuploadenabled" class="tsd-kind-icon">async<wbr>Bitmap<wbr>Upload<wbr>Enabled</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#maxsize" class="tsd-kind-icon">max<wbr>Size</a></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#usedoublebuffering" class="tsd-kind-icon">use<wbr>Double<wbr>Buffering</a></li>
</ul>
</section>
<section class="tsd-index-section tsd-is-external">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.textures.rendertexture.html#clear" class="tsd-kind-icon">clear</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-overwrite tsd-is-external"><a href="starling.textures.rendertexture.html#dispose" class="tsd-kind-icon">dispose</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.textures.rendertexture.html#draw" class="tsd-kind-icon">draw</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-external"><a href="starling.textures.rendertexture.html#drawbundled" class="tsd-kind-icon">draw<wbr>Bundled</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#gettexcoords" class="tsd-kind-icon">get<wbr>Tex<wbr>Coords</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_base" class="tsd-kind-icon">get_<wbr>base</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_format" class="tsd-kind-icon">get_<wbr>format</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_frame" class="tsd-kind-icon">get_<wbr>frame</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_frameheight" class="tsd-kind-icon">get_<wbr>frame<wbr>Height</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_framewidth" class="tsd-kind-icon">get_<wbr>frame<wbr>Width</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_height" class="tsd-kind-icon">get_<wbr>height</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_ispersistent" class="tsd-kind-icon">get_<wbr>is<wbr>Persistent</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_mipmapping" class="tsd-kind-icon">get_<wbr>mip<wbr>Mapping</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_nativeheight" class="tsd-kind-icon">get_<wbr>native<wbr>Height</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_nativewidth" class="tsd-kind-icon">get_<wbr>native<wbr>Width</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_ownsparent" class="tsd-kind-icon">get_<wbr>owns<wbr>Parent</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_parent" class="tsd-kind-icon">get_<wbr>parent</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_premultipliedalpha" class="tsd-kind-icon">get_<wbr>premultiplied<wbr>Alpha</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_region" class="tsd-kind-icon">get_<wbr>region</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_root" class="tsd-kind-icon">get_<wbr>root</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_rotated" class="tsd-kind-icon">get_<wbr>rotated</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_scale" class="tsd-kind-icon">get_<wbr>scale</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_transformationmatrix" class="tsd-kind-icon">get_<wbr>transformation<wbr>Matrix</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_transformationmatrixtoroot" class="tsd-kind-icon">get_<wbr>transformation<wbr>Matrix<wbr>ToRoot</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-external"><a href="starling.textures.rendertexture.html#get_width" class="tsd-kind-icon">get_<wbr>width</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#globaltolocal" class="tsd-kind-icon">global<wbr>ToLocal</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#localtoglobal" class="tsd-kind-icon">local<wbr>ToGlobal</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#settexcoords" class="tsd-kind-icon">set<wbr>Tex<wbr>Coords</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#setuptexturecoordinates" class="tsd-kind-icon">setup<wbr>Texture<wbr>Coordinates</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-external"><a href="starling.textures.rendertexture.html#setupvertexpositions" class="tsd-kind-icon">setup<wbr>Vertex<wbr>Positions</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#empty" class="tsd-kind-icon">empty</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#fromatfdata" class="tsd-kind-icon">from<wbr>Atf<wbr>Data</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#frombitmap" class="tsd-kind-icon">from<wbr>Bitmap</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#frombitmapdata" class="tsd-kind-icon">from<wbr>Bitmap<wbr>Data</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#fromcolor" class="tsd-kind-icon">from<wbr>Color</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#fromdata" class="tsd-kind-icon">from<wbr>Data</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#fromembeddedasset" class="tsd-kind-icon">from<wbr>Embedded<wbr>Asset</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#fromnetstream" class="tsd-kind-icon">from<wbr>Net<wbr>Stream</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#fromtexture" class="tsd-kind-icon">from<wbr>Texture</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#fromtexturebase" class="tsd-kind-icon">from<wbr>Texture<wbr>Base</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#getmaxsize" class="tsd-kind-icon">get<wbr>Max<wbr>Size</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#get_asyncbitmapuploadenabled" class="tsd-kind-icon">get_<wbr>async<wbr>Bitmap<wbr>Upload<wbr>Enabled</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#get_maxsize" class="tsd-kind-icon">get_<wbr>max<wbr>Size</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#get_usedoublebuffering" class="tsd-kind-icon">get_<wbr>use<wbr>Double<wbr>Buffering</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#set_asyncbitmapuploadenabled" class="tsd-kind-icon">set_<wbr>async<wbr>Bitmap<wbr>Upload<wbr>Enabled</a></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected tsd-is-static tsd-is-external"><a href="starling.textures.rendertexture.html#set_usedoublebuffering" class="tsd-kind-icon">set_<wbr>use<wbr>Double<wbr>Buffering</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-external">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite tsd-is-external">
<a name="constructor" class="tsd-anchor"></a>
<h3>constructor</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-is-overwrite tsd-is-external">
<li class="tsd-signature tsd-kind-icon">new <wbr>Render<wbr>Texture<span class="tsd-signature-symbol">(</span>width<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, height<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, persistent<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, scale<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, format<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="starling.textures.rendertexture.html" class="tsd-signature-type">RenderTexture</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<p>Overrides <a href="starling.textures.subtexture.html">SubTexture</a>.<a href="starling.textures.subtexture.html#constructor">constructor</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/RenderTexture.d.ts#L85">lib/starling/textures/RenderTexture.d.ts:85</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Creates a new RenderTexture with a certain size (in points). If the texture is
persistent, its contents remains intact after each draw call, allowing you to use the
texture just like a canvas. If it is not, it will be cleared before each draw call.</p>
</div>
<p>Non-persistent textures can be used more efficiently on older devices; on modern
hardware, it does not make a difference. For more information, have a look at the
documentation of the <code>useDoubleBuffering</code> property.</p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>width: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5>height: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> persistent: <span class="tsd-signature-type">boolean</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> scale: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> format: <span class="tsd-signature-type">string</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="starling.textures.rendertexture.html" class="tsd-signature-type">RenderTexture</a></h4>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-external">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="base" class="tsd-anchor"></a>
<h3>base</h3>
<div class="tsd-signature tsd-kind-icon">base<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">TextureBase</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#base">base</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L446">lib/starling/textures/Texture.d.ts:446</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The Stage3D texture object the texture is based on.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="format" class="tsd-anchor"></a>
<h3>format</h3>
<div class="tsd-signature tsd-kind-icon">format<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Context3DTextureFormat</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#format">format</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L454">lib/starling/textures/Texture.d.ts:454</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The <code>Context3DTextureFormat</code> of the underlying texture data.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="frame" class="tsd-anchor"></a>
<h3>frame</h3>
<div class="tsd-signature tsd-kind-icon">frame<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Rectangle</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#frame">frame</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L412">lib/starling/textures/Texture.d.ts:412</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The texture frame if it has one (see class description), otherwise <code>null</code>.
<p>CAUTION: not a copy, but the actual object! Do not modify!</p></p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="frameheight" class="tsd-anchor"></a>
<h3>frame<wbr>Height</h3>
<div class="tsd-signature tsd-kind-icon">frame<wbr>Height<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#frameheight">frameHeight</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L422">lib/starling/textures/Texture.d.ts:422</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The width of the texture in points, taking into account the frame rectangle
(if there is one).</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="framewidth" class="tsd-anchor"></a>
<h3>frame<wbr>Width</h3>
<div class="tsd-signature tsd-kind-icon">frame<wbr>Width<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#framewidth">frameWidth</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L417">lib/starling/textures/Texture.d.ts:417</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The height of the texture in points, taking into account the frame rectangle
(if there is one).</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="height" class="tsd-anchor"></a>
<h3>height</h3>
<div class="tsd-signature tsd-kind-icon">height<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#height">height</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L430">lib/starling/textures/Texture.d.ts:430</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The height of the texture in points.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-external">
<a name="ispersistent" class="tsd-anchor"></a>
<h3>is<wbr>Persistent</h3>
<div class="tsd-signature tsd-kind-icon">is<wbr>Persistent<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/RenderTexture.d.ts#L140">lib/starling/textures/RenderTexture.d.ts:140</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Indicates if the texture is persistent over multiple draw calls.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="mipmapping" class="tsd-anchor"></a>
<h3>mip<wbr>Mapping</h3>
<div class="tsd-signature tsd-kind-icon">mip<wbr>Mapping<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#mipmapping">mipMapping</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L458">lib/starling/textures/Texture.d.ts:458</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Indicates if the texture contains mip maps.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="nativeheight" class="tsd-anchor"></a>
<h3>native<wbr>Height</h3>
<div class="tsd-signature tsd-kind-icon">native<wbr>Height<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#nativeheight">nativeHeight</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L438">lib/starling/textures/Texture.d.ts:438</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The height of the texture in pixels (without scale adjustment).</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="nativewidth" class="tsd-anchor"></a>
<h3>native<wbr>Width</h3>
<div class="tsd-signature tsd-kind-icon">native<wbr>Width<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#nativewidth">nativeWidth</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L434">lib/starling/textures/Texture.d.ts:434</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The width of the texture in pixels (without scale adjustment).</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="ownsparent" class="tsd-anchor"></a>
<h3>owns<wbr>Parent</h3>
<div class="tsd-signature tsd-kind-icon">owns<wbr>Parent<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.subtexture.html">SubTexture</a>.<a href="starling.textures.subtexture.html#ownsparent">ownsParent</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/SubTexture.d.ts#L40">lib/starling/textures/SubTexture.d.ts:40</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Indicates if the parent texture is disposed when this object is disposed.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="parent" class="tsd-anchor"></a>
<h3>parent</h3>
<div class="tsd-signature tsd-kind-icon">parent<span class="tsd-signature-symbol">:</span> <a href="starling.textures.texture.html" class="tsd-signature-type">Texture</a></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.subtexture.html">SubTexture</a>.<a href="starling.textures.subtexture.html#parent">parent</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/SubTexture.d.ts#L36">lib/starling/textures/SubTexture.d.ts:36</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The texture which the SubTexture is based on.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="premultipliedalpha" class="tsd-anchor"></a>
<h3>premultiplied<wbr>Alpha</h3>
<div class="tsd-signature tsd-kind-icon">premultiplied<wbr>Alpha<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#premultipliedalpha">premultipliedAlpha</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L462">lib/starling/textures/Texture.d.ts:462</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Indicates if the alpha values are premultiplied into the RGB values.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="region" class="tsd-anchor"></a>
<h3>region</h3>
<div class="tsd-signature tsd-kind-icon">region<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Rectangle</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.subtexture.html">SubTexture</a>.<a href="starling.textures.subtexture.html#region">region</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/SubTexture.d.ts#L50">lib/starling/textures/SubTexture.d.ts:50</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The region of the parent texture that the SubTexture is showing (in points).</p>
</div>
<p>CAUTION: not a copy, but the actual object! Do not modify!</p>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="root" class="tsd-anchor"></a>
<h3>root</h3>
<div class="tsd-signature tsd-kind-icon">root<span class="tsd-signature-symbol">:</span> <a href="starling.textures.concretetexture.html" class="tsd-signature-type">ConcreteTexture</a></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#root">root</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L450">lib/starling/textures/Texture.d.ts:450</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The concrete texture the texture is based on.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="rotated" class="tsd-anchor"></a>
<h3>rotated</h3>
<div class="tsd-signature tsd-kind-icon">rotated<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.subtexture.html">SubTexture</a>.<a href="starling.textures.subtexture.html#rotated">rotated</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/SubTexture.d.ts#L44">lib/starling/textures/SubTexture.d.ts:44</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>If true, the SubTexture will show the parent region rotated by 90 degrees (CCW).</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="scale" class="tsd-anchor"></a>
<h3>scale</h3>
<div class="tsd-signature tsd-kind-icon">scale<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#scale">scale</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L442">lib/starling/textures/Texture.d.ts:442</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The scale factor, which influences width and height properties.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="transformationmatrix" class="tsd-anchor"></a>
<h3>transformation<wbr>Matrix</h3>
<div class="tsd-signature tsd-kind-icon">transformation<wbr>Matrix<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Matrix</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#transformationmatrix">transformationMatrix</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L469">lib/starling/textures/Texture.d.ts:469</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The matrix that is used to transform the texture coordinates into the coordinate
space of the parent texture, if there is one. @default null</p>
</div>
<p>CAUTION: not a copy, but the actual object! Never modify this matrix!</p>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="transformationmatrixtoroot" class="tsd-anchor"></a>
<h3>transformation<wbr>Matrix<wbr>ToRoot</h3>
<div class="tsd-signature tsd-kind-icon">transformation<wbr>Matrix<wbr>ToRoot<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Matrix</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#transformationmatrixtoroot">transformationMatrixToRoot</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L476">lib/starling/textures/Texture.d.ts:476</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The matrix that is used to transform the texture coordinates into the coordinate
space of the root texture, if this instance is not the root. @default null</p>
</div>
<p>CAUTION: not a copy, but the actual object! Never modify this matrix!</p>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-external">
<a name="width" class="tsd-anchor"></a>
<h3>width</h3>
<div class="tsd-signature tsd-kind-icon">width<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#width">width</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L426">lib/starling/textures/Texture.d.ts:426</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>The width of the texture in points.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external">
<a name="asyncbitmapuploadenabled" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> async<wbr>Bitmap<wbr>Upload<wbr>Enabled</h3>
<div class="tsd-signature tsd-kind-icon">async<wbr>Bitmap<wbr>Upload<wbr>Enabled<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#asyncbitmapuploadenabled">asyncBitmapUploadEnabled</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L493">lib/starling/textures/Texture.d.ts:493</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Indicates if it should be attempted to upload bitmaps asynchronously when the <code>async</code> parameter
is supplied to supported methods. Since this feature is still not 100% reliable in AIR 26 (especially on
Android), it defaults to 'false' for now.</p>
</div>
<p>If the feature is disabled or not available in the current AIR/Flash runtime, the async callback will
still be executed; however, the upload itself will be made synchronously.</p>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-static tsd-is-external">
<a name="maxsize" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> max<wbr>Size</h3>
<div class="tsd-signature tsd-kind-icon">max<wbr>Size<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<p>Inherited from <a href="starling.textures.texture.html">Texture</a>.<a href="starling.textures.texture.html#maxsize">maxSize</a></p>
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/Texture.d.ts#L481">lib/starling/textures/Texture.d.ts:481</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Returns the maximum size constraint (for both width and height) for uncompressed
textures in the current Context3D profile.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-static tsd-is-external">
<a name="usedoublebuffering" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagStatic">Static</span> use<wbr>Double<wbr>Buffering</h3>
<div class="tsd-signature tsd-kind-icon">use<wbr>Double<wbr>Buffering<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/RenderTexture.d.ts#L152">lib/starling/textures/RenderTexture.d.ts:152</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Indicates if new persistent textures should use double buffering. Single buffering
is faster and requires less memory, but is not supported on all hardware.</p>
</div>
<p>By default, applications running with the profile "baseline" or "baselineConstrained"
will use double buffering; all others use just a single buffer. You can override this
behavior, though, by assigning a different value at runtime.</p>
<p> @default true for "baseline" and "baselineConstrained", false otherwise</p>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group tsd-is-external">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-external">
<a name="clear" class="tsd-anchor"></a>
<h3>clear</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-external">
<li class="tsd-signature tsd-kind-icon">clear<span class="tsd-signature-symbol">(</span>color<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, alpha<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/openfl/starling/blob/bce2af2/lib/starling/textures/RenderTexture.d.ts#L135">lib/starling/textures/RenderTexture.d.ts:135</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Clears the render texture with a certain color and alpha value. Call without any
arguments to restore full transparency.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> color: <span class="tsd-signature-type">number</span></h5>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> alpha: <span class="