duckengine
Version:
A 2D Game Engine for the web.
73 lines • 44.8 kB
HTML
<html class="default no-js"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Texture | DuckEngine - v2.1.0</title><meta name="description" content="Documentation for DuckEngine - v2.1.0"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></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">DuckEngine - v2.1.0</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></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="../modules.html">DuckEngine - v2.1.0</a></li><li><a href="../modules/core_texture_texture.html">core/texture/texture</a></li><li><a href="core_texture_texture.Texture.html">Texture</a></li></ul><h1>Class Texture<type></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"><dl class="tsd-comment-tags"><dt>classdesc</dt><dd><p>Creates a DuckEngine Texture</p>
</dd><dt>description</dt><dd><p>The Texture Class. Stores images and colors in a class</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-type-parameters"><h3>Type parameters</h3><ul class="tsd-type-parameters"><li><h4>type<span class="tsd-signature-symbol">: </span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html" class="tsd-signature-type" data-tsd-kind="Namespace">Texture</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html#Type" class="tsd-signature-type" data-tsd-kind="Type alias">Type</a></h4><div class="tsd-comment tsd-typography"><div class="lead">
<p>Texture type, 'image' | 'color' | 'either'</p>
</div></div></li></ul></section><section class="tsd-panel tsd-hierarchy"><h3>Hierarchy</h3><ul class="tsd-hierarchy"><li><a href="core_texture_textureBase.TextureBase.html" class="tsd-signature-type" data-tsd-kind="Class">TextureBase</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol">></span><ul class="tsd-hierarchy"><li><span class="target">Texture</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 "><h3>Constructors</h3><ul class="tsd-index-list"><li class="tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-overwrite"><a href="core_texture_texture.Texture.html#constructor" class="tsd-kind-icon">constructor</a></li></ul></section><section class="tsd-index-section tsd-is-inherited"><h3>Properties</h3><ul class="tsd-index-list"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#dataType" class="tsd-kind-icon">data<wbr/>Type</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#scale" class="tsd-kind-icon">scale</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#texture" class="tsd-kind-icon">texture</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#type" class="tsd-kind-icon">type</a></li></ul></section><section class="tsd-index-section tsd-is-inherited"><h3>Methods</h3><ul class="tsd-index-list"><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#setFillColor" class="tsd-kind-icon">set<wbr/>Fill<wbr/>Color</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#setImagePath" class="tsd-kind-icon">set<wbr/>Image<wbr/>Path</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#setScale" class="tsd-kind-icon">set<wbr/>Scale</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><a href="core_texture_texture.Texture.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"><a href="core_texture_texture.Texture.html#fromEither" class="tsd-kind-icon">from<wbr/>Either</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><a href="core_texture_texture.Texture.html#fromTexture" class="tsd-kind-icon">from<wbr/>Texture</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Constructors</h2><section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-overwrite"><a id="constructor" class="tsd-anchor"></a><h3>constructor</h3><ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-overwrite"><li class="tsd-signature tsd-kind-icon">new <wbr/>Texture<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>type<span class="tsd-signature-symbol">: </span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html" class="tsd-signature-type" data-tsd-kind="Namespace">Texture</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html#Type" class="tsd-signature-type" data-tsd-kind="Type alias">Type</a>, texture<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-type">"image"</span><span class="tsd-signature-symbol"> ? </span><span class="tsd-signature-type">HTMLImageElement</span><span class="tsd-signature-symbol"> : </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-type">"either"</span><span class="tsd-signature-symbol"> ? </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLImageElement</span><span class="tsd-signature-symbol"> : </span><span class="tsd-signature-type">string</span>, w<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, h<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><a href="core_texture_texture.Texture.html" class="tsd-signature-type" data-tsd-kind="Class">Texture</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Overrides <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#constructor">constructor</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/texture.ts#L24">core/texture/texture.ts:24</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>description</dt><dd><p>Creates a texture</p>
</dd><dt>since</dt><dd><p>2.0.0</p>
</dd></dl></div><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>type<span class="tsd-signature-symbol">: </span><a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html" class="tsd-signature-type" data-tsd-kind="Namespace">Texture</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html#Type" class="tsd-signature-type" data-tsd-kind="Type alias">Type</a></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>type: <a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html" class="tsd-signature-type" data-tsd-kind="Namespace">Texture</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html#Type" class="tsd-signature-type" data-tsd-kind="Type alias">Type</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Texture type</p>
</div></div></li><li><h5>texture: <span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-type">"image"</span><span class="tsd-signature-symbol"> ? </span><span class="tsd-signature-type">HTMLImageElement</span><span class="tsd-signature-symbol"> : </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-type">"either"</span><span class="tsd-signature-symbol"> ? </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLImageElement</span><span class="tsd-signature-symbol"> : </span><span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Texture source</p>
</div></div></li><li><h5>w: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Width of texture</p>
</div></div></li><li><h5>h: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Height of texture</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="core_texture_texture.Texture.html" class="tsd-signature-type" data-tsd-kind="Class">Texture</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol">></span></h4></li></ul></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="dataType" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> data<wbr/>Type</h3><div class="tsd-signature tsd-kind-icon">data<wbr/>Type<span class="tsd-signature-symbol">:</span> <a href="../modules/index.Duck.Types.Texture.html#DataType" class="tsd-signature-type" data-tsd-kind="Type alias">DataType</a></div><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#dataType">dataType</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L28">core/texture/textureBase.ts:28</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>TextureBase</p>
</dd><dt>description</dt><dd><p>The data type of texture, 'sheet' | 'base' | 'atlas' | 'list'</p>
</dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="id" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagReadonly">Readonly</span> id</h3><div class="tsd-signature tsd-kind-icon">id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#id">id</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L12">core/texture/textureBase.ts:12</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>TextureBase</p>
</dd><dt>description</dt><dd><p>The unique identifier for the texture</p>
</dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="scale" class="tsd-anchor"></a><h3>scale</h3><div class="tsd-signature tsd-kind-icon">scale<span class="tsd-signature-symbol">:</span> <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></div><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#scale">scale</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L48">core/texture/textureBase.ts:48</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>Texture</p>
</dd><dt>description</dt><dd><p>The scale of the texture</p>
</dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="texture" class="tsd-anchor"></a><h3>texture</h3><div class="tsd-signature tsd-kind-icon">texture<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-type">"image"</span><span class="tsd-signature-symbol"> ? </span><span class="tsd-signature-type">HTMLImageElement</span><span class="tsd-signature-symbol"> : </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">type</span><span class="tsd-signature-symbol"> extends </span><span class="tsd-signature-type">"either"</span><span class="tsd-signature-symbol"> ? </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLImageElement</span><span class="tsd-signature-symbol"> : </span><span class="tsd-signature-type">string</span></div><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#texture">texture</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L36">core/texture/textureBase.ts:36</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>TextureBase</p>
</dd><dt>description</dt><dd><p>The texture itself, can be an image or color</p>
</dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div></section><section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a id="type" class="tsd-anchor"></a><h3>type</h3><div class="tsd-signature tsd-kind-icon">type<span class="tsd-signature-symbol">:</span> <a href="../modules/index.Duck.html" class="tsd-signature-type" data-tsd-kind="Namespace">Duck</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.html" class="tsd-signature-type" data-tsd-kind="Namespace">Types</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html" class="tsd-signature-type" data-tsd-kind="Namespace">Texture</a><span class="tsd-signature-symbol">.</span><a href="../modules/index.Duck.Types.Texture.html#Type" class="tsd-signature-type" data-tsd-kind="Type alias">Type</a></div><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#type">type</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L20">core/texture/textureBase.ts:20</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>TextureBase</p>
</dd><dt>description</dt><dd><p>The type of texture source, 'image' | 'color' | 'either'</p>
</dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div></section></section><section class="tsd-panel-group tsd-member-group tsd-is-inherited"><h2>Methods</h2><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="setFillColor" class="tsd-anchor"></a><h3>set<wbr/>Fill<wbr/>Color</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">set<wbr/>Fill<wbr/>Color<span class="tsd-signature-symbol">(</span>color<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><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"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#setFillColor">setFillColor</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L169">core/texture/textureBase.ts:169</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>Texture</p>
</dd><dt>description</dt><dd><p>Sets the Texture color if the type is color</p>
</dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>color: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>New color of the texture</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="setImagePath" class="tsd-anchor"></a><h3>set<wbr/>Image<wbr/>Path</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">set<wbr/>Image<wbr/>Path<span class="tsd-signature-symbol">(</span>imagePath<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><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#setImagePath">setImagePath</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L157">core/texture/textureBase.ts:157</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>Texture</p>
</dd><dt>description</dt><dd><p>Sets the Texture Image Path if the type is image</p>
</dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>imagePath: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>New imagePath of the texture</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a id="setScale" class="tsd-anchor"></a><h3>set<wbr/>Scale</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><li class="tsd-signature tsd-kind-icon">set<wbr/>Scale<span class="tsd-signature-symbol">(</span>scale<span class="tsd-signature-symbol">: </span><a href="../interfaces/index.Duck.Types.Misc.Scale.html" class="tsd-signature-type" data-tsd-kind="Interface">Scale</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#setScale">setScale</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L140">core/texture/textureBase.ts:140</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>Texture</p>
</dd><dt>description</dt><dd><p>Sets the Texture Scale</p>
</dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>scale: <a href="../interfaces/index.Duck.Types.Misc.Scale.html" class="tsd-signature-type" data-tsd-kind="Interface">Scale</a></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>New scale of the texture</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="core_math_vector2.Vector2.html" class="tsd-signature-type" data-tsd-kind="Class">Vector2</a></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><a id="fromColor" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> from<wbr/>Color</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><li class="tsd-signature tsd-kind-icon">from<wbr/>Color<span class="tsd-signature-symbol">(</span>color<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, w<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, h<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><a href="core_texture_textureBase.TextureBase.html" class="tsd-signature-type" data-tsd-kind="Class">TextureBase</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">"color"</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#fromColor">fromColor</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L185">core/texture/textureBase.ts:185</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>TextureBase</p>
</dd><dt>description</dt><dd><p>Creates a new TextureBase instance from a color</p>
</dd><dt>static</dt><dd></dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>color: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Color</p>
</div></div></li><li><h5>w: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Width</p>
</div></div></li><li><h5>h: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Height</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="core_texture_textureBase.TextureBase.html" class="tsd-signature-type" data-tsd-kind="Class">TextureBase</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">"color"</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><a id="fromEither" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> from<wbr/>Either</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><li class="tsd-signature tsd-kind-icon">from<wbr/>Either<span class="tsd-signature-symbol">(</span>fillColorOrIMGPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, w<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, h<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><a href="core_texture_textureBase.TextureBase.html" class="tsd-signature-type" data-tsd-kind="Class">TextureBase</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">"either"</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#fromEither">fromEither</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L216">core/texture/textureBase.ts:216</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>TextureBase</p>
</dd><dt>description</dt><dd><p>Creates a new TextureBase instance from a color or an image path</p>
</dd><dt>static</dt><dd></dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>fillColorOrIMGPath: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Color or Image path</p>
</div></div></li><li><h5>w: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Width</p>
</div></div></li><li><h5>h: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Height</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="core_texture_textureBase.TextureBase.html" class="tsd-signature-type" data-tsd-kind="Class">TextureBase</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">"either"</span><span class="tsd-signature-symbol">></span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><a id="fromTexture" class="tsd-anchor"></a><h3><span class="tsd-flag ts-flagStatic">Static</span> from<wbr/>Texture</h3><ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><li class="tsd-signature tsd-kind-icon">from<wbr/>Texture<span class="tsd-signature-symbol">(</span>imgpath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, w<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, h<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><a href="core_texture_textureBase.TextureBase.html" class="tsd-signature-type" data-tsd-kind="Class">TextureBase</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">"image"</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><p>Inherited from <a href="core_texture_textureBase.TextureBase.html">TextureBase</a>.<a href="core_texture_textureBase.TextureBase.html#fromTexture">fromTexture</a></p><ul><li>Defined in <a href="https://github.com/ksplatdev/DuckEngine/blob/717462d/src/core/texture/textureBase.ts#L199">core/texture/textureBase.ts:199</a></li></ul></aside><div class="tsd-comment tsd-typography"><dl class="tsd-comment-tags"><dt>memberof</dt><dd><p>TextureBase</p>
</dd><dt>description</dt><dd><p>Creates a new TextureBase instance from an image path</p>
</dd><dt>static</dt><dd></dd><dt>since</dt><dd><p>2.1.0</p>
</dd></dl></div><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>imgpath: <span class="tsd-signature-type">string</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Image path</p>
</div></div></li><li><h5>w: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Width</p>
</div></div></li><li><h5>h: <span class="tsd-signature-type">number</span></h5><div class="tsd-comment tsd-typography"><div class="lead">
<p>Height</p>
</div></div></li></ul><h4 class="tsd-returns-title">Returns <a href="core_texture_textureBase.TextureBase.html" class="tsd-signature-type" data-tsd-kind="Class">TextureBase</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">"image"</span><span class="tsd-signature-symbol">></span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="../modules/core_animation_animation.html">core/animation/animation</a></li><li class=" tsd-kind-module"><a href="../modules/core_animation_animationFrame.html">core/animation/animation<wbr/>Frame</a></li><li class=" tsd-kind-module"><a href="../modules/core_animation_animationManager.html">core/animation/animation<wbr/>Manager</a></li><li class=" tsd-kind-module"><a href="../modules/core_animation_animationState.html">core/animation/animation<wbr/>State</a></li><li class=" tsd-kind-module"><a href="../modules/core_animation_stateMachine.html">core/animation/state<wbr/>Machine</a></li><li class=" tsd-kind-module"><a href="../modules/core_camera_camera.html">core/camera/camera</a></li><li class=" tsd-kind-module"><a href="../modules/core_cutscene_cutscene.html">core/cutscene/cutscene</a></li><li class=" tsd-kind-module"><a href="../modules/core_debug_debug.html">core/debug/debug</a></li><li class=" tsd-kind-module"><a href="../modules/core_display_displayManager.html">core/display/display<wbr/>Manager</a></li><li class=" tsd-kind-module"><a href="../modules/core_effect_effect.html">core/effect/effect</a></li><li class=" tsd-kind-module"><a href="../modules/core_effect_preset_explosion.html">core/effect/preset/explosion</a></li><li class=" tsd-kind-module"><a href="../modules/core_effect_preset_smoke.html">core/effect/preset/smoke</a></li><li class=" tsd-kind-module"><a href="../modules/core_events_eventEmitter.html">core/events/event<wbr/>Emitter</a></li><li class=" tsd-kind-module"><a href="../modules/core_events_events.html">core/events/events</a></li><li class=" tsd-kind-module"><a href="../modules/core_events_main_displayEvents.html">core/events/main/display<wbr/>Events</a></li><li class=" tsd-kind-module"><a href="../modules/core_events_main_gameEvents.html">core/events/main/game<wbr/>Events</a></li><li class=" tsd-kind-module"><a href="../modules/core_events_main_rendererEvents.html">core/events/main/renderer<wbr/>Events</a></li><li class=" tsd-kind-module"><a href="../modules/core_events_other_buttonEvents.html">core/events/other/button<wbr/>Events</a></li><li class=" tsd-kind-module"><a href="../modules/core_events_other_cutsceneEvents.html">core/events/other/cutscene<wbr/>Events</a></li><li class=" tsd-kind-module"><a href="../modules/core_events_other_groupEvents.html">core/events/other/group<wbr/>Events</a></li><li class=" tsd-kind-module"><a href="../modules/core_game.html">core/game</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_circle.html">core/gameobjects/circle</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_gameObject.html">core/gameobjects/game<wbr/>Object</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_misc_canvasModulate.html">core/gameobjects/misc/canvas<wbr/>Modulate</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_particles_particle.html">core/gameobjects/particles/particle</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_particles_particleEmitter.html">core/gameobjects/particles/particle<wbr/>Emitter</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_rect.html">core/gameobjects/rect</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_roundrect.html">core/gameobjects/roundrect</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_sprite.html">core/gameobjects/sprite</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_ui_button.html">core/gameobjects/ui/button</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_ui_imageRect.html">core/gameobjects/ui/image<wbr/>Rect</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_ui_panel.html">core/gameobjects/ui/panel</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_ui_text.html">core/gameobjects/ui/text</a></li><li class=" tsd-kind-module"><a href="../modules/core_gameobjects_ui_ui.html">core/gameobjects/ui/ui</a></li><li class=" tsd-kind-module"><a href="../modules/core_group_group.html">core/group/group</a></li><li class=" tsd-kind-module"><a href="../modules/core_input_input.html">core/input/input</a></li><li class=" tsd-kind-module"><a href="../modules/core_input_keyboardInput.html">core/input/keyboard<wbr/>Input</a></li><li class=" tsd-kind-module"><a href="../modules/core_input_models_key.html">core/input/models/key</a></li><li class=" tsd-kind-module"><a href="../modules/core_input_models_mouse.html">core/input/models/mouse</a></li><li class=" tsd-kind-module"><a href="../modules/core_input_mouseInput.html">core/input/mouse<wbr/>Input</a></li><li class=" tsd-kind-module"><a href="../modules/core_lights_staticLight.html">core/lights/static<wbr/>Light</a></li><li class=" tsd-kind-module"><a href="../modules/core_loader_loader.html">core/loader/loader</a></li><li class=" tsd-kind-module"><a href="../modules/core_map_map.html">core/map/map</a></li><li class=" tsd-kind-module"><a href="../modules/core_map_tile.html">core/map/tile</a></li><li class=" tsd-kind-module"><a href="../modules/core_map_tilelayer.html">core/map/tilelayer</a></li><li class=" tsd-kind-module"><a href="../modules/core_map_tilemap.html">core/map/tilemap</a></li><li class=" tsd-kind-module"><a href="../modules/core_map_tileset.html">core/map/tileset</a></li><li class=" tsd-kind-module"><a href="../modules/core_math_clamp.html">core/math/clamp</a></li><li class=" tsd-kind-module"><a href="../modules/core_math_lerp.html">core/math/lerp</a></li><li class=" tsd-kind-module"><a href="../modules/core_math_randomFloat.html">core/math/random<wbr/>Float</a></li><li class=" tsd-kind-module"><a href="../modules/core_math_randomInt.html">core/math/random<wbr/>Int</a></li><li class=" tsd-kind-module"><a href="../modules/core_math_vector2.html">core/math/vector2</a></li><li class=" tsd-kind-module"><a href="../modules/core_misc_pluginManager.html">core/misc/plugin<wbr/>Manager</a></li><li class=" tsd-kind-module"><a href="../modules/core_models_displayList.html">core/models/display<wbr/>List</a></li><li class=" tsd-kind-module"><a href="../modules/core_models_physicsList.html">core/models/physics<wbr/>List</a></li><li class=" tsd-kind-module"><a href="../modules/core_physics_models_area.html">core/physics/models/area</a></li><li class=" tsd-kind-module"><a href="../modules/core_physics_models_collider.html">core/physics/models/collider</a></li><li class=" tsd-kind-module"><a href="../modules/core_physics_models_hitbox.html">core/physics/models/hitbox</a></li><li class=" tsd-kind-module"><a href="../modules/core_physics_physicsBody.html">core/physics/physics<wbr/>Body</a></li><li class=" tsd-kind-module"><a href="../modules/core_physics_server_physicsServer.html">core/physics/server/physics<wbr/>Server</a></li><li class=" tsd-kind-module"><a href="../modules/core_physics_utils_circleToRectIntersect.html">core/physics/utils/circle<wbr/>To<wbr/>Rect<wbr/>Intersect</a></li><li class=" tsd-kind-module"><a href="../modules/core_physics_utils_hitboxFaceIntersect.html">core/physics/utils/hitbox<wbr/>Face<wbr/>Intersect</a></li><li class=" tsd-kind-module"><a href="../modules/core_physics_utils_rectToRectIntersect.html">core/physics/utils/rect<wbr/>To<wbr/>Rect<wbr/>Intersect</a></li><li class=" tsd-kind-module"><a href="../modules/core_renderer_baseRenderer.html">core/renderer/base<wbr/>Renderer</a></li><li class=" tsd-kind-module"><a href="../modules/core_renderer_canvas_canvasRenderer.html">core/renderer/canvas/canvas<wbr/>Renderer</a></li><li class=" tsd-kind-module"><a href="../modules/core_renderer_canvas_const_blendModes.html">core/renderer/canvas/const/blend<wbr/>Modes</a></li><li class=" tsd-kind-module"><a href="../modules/core_renderer_canvas_pipeline_rendererPipeline.html">core/renderer/canvas/pipeline/renderer<wbr/>Pipeline</a></li><li class=" tsd-kind-module"><a href="../modules/core_scene.html">core/scene</a></li><li class=" tsd-kind-module"><a href="../modules/core_sound_soundPlayer.html">core/sound/sound<wbr/>Player</a></li><li class=" tsd-kind-module"><a href="../modules/core_storage_cacheManager.html">core/storage/cache<wbr/>Manager</a></li><li class="current tsd-kind-module"><a href="../modules/core_texture_texture.html">core/texture/texture</a></li><li class=" tsd-kind-module"><a href="../modules/core_texture_textureAtlas.html">core/texture/texture<wbr/>Atlas</a></li><li class=" tsd-kind-module"><a href="../modules/core_texture_textureBase.html">core/texture/texture<wbr/>Base</a></li><li class=" tsd-kind-module"><a href="../modules/core_texture_textureSheet.html">core/texture/texture<wbr/>Sheet</a></li><li class=" tsd-kind-module"><a href="../modules/index.html">index</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="current tsd-kind-class tsd-parent-kind-module tsd-has-type-parameter"><a href="core_texture_texture.Texture.html" class="tsd-kind-icon">Texture</a><ul><li class="tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-overwrite"><a href="core_texture_texture.Texture.html#constructor" class="tsd-kind-icon">constructor</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#dataType" class="tsd-kind-icon">data<wbr/>Type</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#id" class="tsd-kind-icon">id</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#scale" class="tsd-kind-icon">scale</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#texture" class="tsd-kind-icon">texture</a></li><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#type" class="tsd-kind-icon">type</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#setFillColor" class="tsd-kind-icon">set<wbr/>Fill<wbr/>Color</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#setImagePath" class="tsd-kind-icon">set<wbr/>Image<wbr/>Path</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="core_texture_texture.Texture.html#setScale" class="tsd-kind-icon">set<wbr/>Scale</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><a href="core_texture_texture.Texture.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"><a href="core_texture_texture.Texture.html#fromEither" class="tsd-kind-icon">from<wbr/>Either</a></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-static"><a href="core_texture_texture.Texture.html#fromTexture" class="tsd-kind-icon">from<wbr/>Texture</a></li></ul></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li><li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li><li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li><li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>