diff options
Diffstat (limited to 'manuals/chickadee/Textures.html')
-rw-r--r-- | manuals/chickadee/Textures.html | 110 |
1 files changed, 105 insertions, 5 deletions
diff --git a/manuals/chickadee/Textures.html b/manuals/chickadee/Textures.html index b9bb778..f7de7ab 100644 --- a/manuals/chickadee/Textures.html +++ b/manuals/chickadee/Textures.html @@ -1,6 +1,6 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> -<!-- Copyright (C) 2017 David Thompson davet@gnu.org +<!-- Copyright (C) 2017, 2018, 2019 David Thompson davet@gnu.org Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 @@ -13,6 +13,8 @@ A copy of the license is also available from the Free Software Foundation Web site at http://www.gnu.org/licenses/fdl.html. +* Chickadee: (chickadee). Game programming toolkit for Guile. + The document was typeset with http://www.texinfo.org/ (GNU Texinfo). --> @@ -31,7 +33,7 @@ http://www.texinfo.org/ (GNU Texinfo). <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> <link href="Graphics.html#Graphics" rel="up" title="Graphics"> <link href="Sprites.html#Sprites" rel="next" title="Sprites"> -<link href="Rendering-Engine.html#Rendering-Engine" rel="prev" title="Rendering Engine"> +<link href="Graphics.html#Graphics" rel="prev" title="Graphics"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} @@ -90,14 +92,14 @@ ul.no-bullet {list-style: none} <a name="Textures"></a> <div class="header"> <p> -Next: <a href="Sprites.html#Sprites" accesskey="n" rel="next">Sprites</a>, Previous: <a href="Rendering-Engine.html#Rendering-Engine" accesskey="p" rel="prev">Rendering Engine</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p> +Next: <a href="Sprites.html#Sprites" accesskey="n" rel="next">Sprites</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p> </div> <hr> <a name="Textures-1"></a> -<h4 class="subsection">2.3.2 Textures</h4> +<h4 class="subsection">2.3.1 Textures</h4> <dl> -<dt><a name="index-load_002dimage"></a>Procedure: <strong>load-image</strong> <em><var>file</var> [#:min-filter nearest] [#:mag-filter nearest] [#:wrap-s repeat] [#:wrap-t repeat]</em></dt> +<dt><a name="index-load_002dimage"></a>Procedure: <strong>load-image</strong> <em>file [#:min-filter nearest] [#:mag-filter nearest] [#:wrap-s repeat] [#:wrap-t repeat]</em></dt> <dd> <p>Load the image data from <var>file</var> and return a new texture object. </p> @@ -112,6 +114,104 @@ coordinates that are greater than <code>1.0</code>. Possible values are </p> </dd></dl> +<dl> +<dt><a name="index-texture_003f"></a>Procedure: <strong>texture?</strong> <em>obj</em></dt> +<dd><p>Return <code>#t</code> if <var>obj</var> is a texture. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002dregion_003f"></a>Procedure: <strong>texture-region?</strong> <em>obj</em></dt> +<dd><p>Return <code>#t</code> if <var>obj</var> is a texture region. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002dparent"></a>Procedure: <strong>texture-parent</strong> <em>texture</em></dt> +<dd><p>If <var>texture</var> is a texture region, return the full texture that it +is based upon. Otherwise, return <code>#f</code>. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002dmin_002dfilter"></a>Procedure: <strong>texture-min-filter</strong> <em>texture</em></dt> +<dd><p>Return the minification filter for <var>texture</var>, either +<code>nearest</code> or <code>linear</code>. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002dmag_002dfilter"></a>Procedure: <strong>texture-mag-filter</strong> <em>texture</em></dt> +<dd><p>Return the magnification filter for <var>texture</var>, either +<code>nearest</code> or <code>linear</code>. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002dwrap_002ds"></a>Procedure: <strong>texture-wrap-s</strong> <em>texture</em></dt> +<dd><p>Return the method used for wrapping texture coordinates along the X +axis for <var>texture</var>. +</p> +<p>Possible wrapping methods: +</p><ul> +<li> <code>repeat</code> +</li><li> <code>clamp</code> +</li><li> <code>clamp-to-border</code> +</li><li> <code>clamp-to-edge</code> +</li></ul> + +</dd></dl> + +<dl> +<dt><a name="index-texture_002dwrap_002dt"></a>Procedure: <strong>texture-wrap-t</strong> <em>texture</em></dt> +<dd><p>Return the method used for wrapping texture coordinates along the Y +axis for <var>texture</var>. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002dwidth"></a>Procedure: <strong>texture-width</strong> <em>texture</em></dt> +<dd><p>Return the width of <var>texture</var> in pixels. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002dheight"></a>Procedure: <strong>texture-height</strong> <em>texture</em></dt> +<dd><p>Return the height of <var>texture</var> in pixels. +</p></dd></dl> + +<p>It is common practice to combine multiple bitmap images into a single +texture, known as a “tile atlas” or “tile set”, because it is more +efficient to render many regions of a large texture than it is to +render a bunch of small textures. Chickadee provides a tile atlas +data type for collecting texture regions into a single vector. +</p> +<dl> +<dt><a name="index-split_002dtexture"></a>Procedure: <strong>split-texture</strong> <em>texture tile-width tile-height [#:margin 0] [#:spacing 0]</em></dt> +<dd> +<p>Return a new texture atlas that splits <var>texture</var> into a grid of +<var>tile-width</var> by <var>tile-height</var> rectangles. Optionally, each +tile may have <var>spacing</var> pixels of horizontal and vertical space +between surrounding tiles and the entire image may have <var>margin</var> +pixels of empty space around its border. +</p> +<p>This type of texture atlas layout is very common for 2D tile maps. +See <a href="Tile-Maps.html#Tile-Maps">Tile Maps</a> for more information. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002datlas_003f"></a>Procedure: <strong>texture-atlas?</strong> <em>obj</em></dt> +<dd><p>Return <code>#t</code> if <var>obj</var> is a texture atlas. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002datlas_002dtexture"></a>Procedure: <strong>texture-atlas-texture</strong> <em>atlas</em></dt> +<dd><p>Return the texture that all texture regions in <var>atlas</var> have been created from. +</p></dd></dl> + +<dl> +<dt><a name="index-texture_002datlas_002dref"></a>Procedure: <strong>texture-atlas-ref</strong> <em>atlas index</em></dt> +<dd><p>Return the texture region in <var>atlas</var> at <var>index</var>. +</p></dd></dl> + +<hr> +<div class="header"> +<p> +Next: <a href="Sprites.html#Sprites" accesskey="n" rel="next">Sprites</a>, Up: <a href="Graphics.html#Graphics" accesskey="u" rel="up">Graphics</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p> +</div> |