Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 74fbd0eb33bb08f719b79951bc4e329e > files > 104

xconq-7.5.0-1.20050612.5mdv2009.1.i586.rpm

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.39
     from ./xcdesign.texi on 12 June 2005 -->

<TITLE>Designing Games with Xconq - Image Families</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="xcdesign_1.html">first</A>, <A HREF="xcdesign_54.html">previous</A>, <A HREF="xcdesign_56.html">next</A>, <A HREF="xcdesign_61.html">last</A> section, <A HREF="xcdesign_toc.html">table of contents</A>.
<HR>


<H2><A NAME="SEC281" HREF="xcdesign_toc.html#SEC281">Image Families</A></H2>

<P>
The <CODE>imf</CODE> form defines graphical images in a platform-independent
way.  An <I>image family</I> is a named collection of images of varying
sizes and depths.

</P>
<P>
<U>Form:</U> <B><CODE>imf</CODE></B> <I>name [ properties ] [ images ]</I><P>
<A NAME="IDX991"></A>
This form declares an image family to exist, with the name <VAR>name</VAR>
and <VAR>properties</VAR>, and consisting of the specified <VAR>images</VAR>.
Each image has the form

<PRE>
<CODE>((<VAR>w</VAR> <VAR>h</VAR> <VAR>special</VAR>) [ <VAR>properties</VAR> ] (<VAR>type</VAR> <VAR>data</VAR>...) ...)</CODE>
</PRE>

<P>
where <VAR>w</VAR> and <VAR>h</VAR> are its width and height, respectively,
<VAR>special</VAR> indicates special characteristics of the image, the
<VAR>type</VAR> may be one of <CODE>color</CODE>, <CODE>mono</CODE>, <CODE>mask</CODE>, or
<CODE>file</CODE>, and the <VAR>data</VAR> consists of strings of hexadecimal
digits.  The data strings may include slashes, which have no effect on
interpretation, but are useful to indicate each row of an image.  Color
images may also have additional properties, which come between the
<VAR>type</VAR> and the <VAR>data</VAR>.

</P>
<P>
The family's <VAR>name</VAR> may consist only of alphabetic characters,
decimal digits, and hyphens or underscores.  Upper- and lower-case
characters are equivalent, as are hyphens and underscores.  The
canonical form of the name is lowercase with hyphens.

</P>
<P>
Multiple forms with the same name may occur, and each adds to the
family, overwriting individual image parts that are of the same size and
depth.

</P>
<P>
<U>Symbol:</U> <B><CODE>tile</CODE></B><P>
<A NAME="IDX992"></A>
If this symbol appears following the dimensions of an image, it
indicates that the image is a pattern tile rather than a single image.

</P>
<P>
<U>Symbol:</U> <B><CODE>border</CODE></B><P>
<A NAME="IDX993"></A>
If this symbol appears following the dimensions of an image, it
indicates that the image is a set of images for border terrain.  Borders
have 16 subimages, each showing a different sort of junction between
cells.

</P>
<P>
<U>Symbol:</U> <B><CODE>connection</CODE></B><P>
<A NAME="IDX994"></A>
If this symbol appears following the dimensions of an image, it
indicates that the image is a set of images for connection terrain.
Connections have 64 subimages, each for a different pattern of
connectons to adjacent cells.

</P>
<P>
<U>Symbol:</U> <B><CODE>transition</CODE></B><P>
<A NAME="IDX995"></A>
This symbol indicates that the terrain is a transition pattern
used to blend two types of terrain.  Transitions consist of
at least 4 subimages, and may have several variants that can
be chosen randomly.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>actual</CODE></B> <I>w h</I><P>
<A NAME="IDX996"></A>
This property is the actual size of the image data.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>embed</CODE></B> <I>name</I><P>
<A NAME="IDX997"></A>
This property specifies that another image, similar to the image family
named by <VAR>name</VAR>, is already embedded within the image, and so
<I>Xconq</I> need not superimpose such an image itself.  This may occur
when an image has a "builtin" side emblem, or is readily identifiable
as belonging to a particular side, and it would be redundant for
<I>Xconq</I> to add an emblem when displaying a unit.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>embed-at</CODE></B> <I>x y</I><P>
<A NAME="IDX998"></A>
This property specifies that the area of the image at <I>x,y</I> is
suitable for the display of an emblem.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>embed-size</CODE></B> <I>w h</I><P>
<A NAME="IDX999"></A>
This property specifies the dimensions of the area available for an
emblem.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>x</CODE></B> <I>n [ x y ]</I><P>
<A NAME="IDX1000"></A>
This property specifies that the image includes <VAR>n</VAR> variant
subimages, any of which may be randomly chosen by an interface.  The
optional numbers <VAR>x</VAR> and <VAR>y</VAR> indicate the offset of each
subimage, so for instance an x of 32 and a y of 0 indicates a horizontal
strip of images, each 32 pixels apart.  Their values default to the
width of the image and 0, respectively.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>notes</CODE></B> <I>list</I><P>
<A NAME="IDX1001"></A>
This property is for designer notes about the image.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>mono</CODE></B> <I>data ...</I><P>
<A NAME="IDX1002"></A>
This property indicates that the data represents a monochrome image.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>mask</CODE></B> <I>data ...</I><P>
<A NAME="IDX1003"></A>
This property indicates that the data represents a mask.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>color</CODE></B> <I>[ properties ] data ...</I><P>
<A NAME="IDX1004"></A>
This property indicates that the data represents a color image.

</P>
<P>
<U>ColorImageProperty:</U> <B><CODE>pixel-size</CODE></B> <I>n</I><P>
<A NAME="IDX1005"></A>
This property is the number of bits used to encode each pixel.

</P>
<P>
<U>ColorImageProperty:</U> <B><CODE>palette</CODE></B> <I>[ (index r g b) ... ]</I><P>
<A NAME="IDX1006"></A>
This property is the color palette that should be used with the image.

</P>
<P>
<U>ImageProperty:</U> <B><CODE>file</CODE></B> <I>filename [ <CODE>std</CODE> ] [ x y ]</I><P>
<A NAME="IDX1007"></A>
This property indicates that the image data is in a file named
<VAR>filename</VAR>.  <VAR>filename</VAR> must contain a recognized type of image
(GIF only, at present).  The optional <VAR>x</VAR> and <VAR>y</VAR> indicate the
position of the upper left corner of the image within the larger picture
contained in the file.

</P>
<P>
If the optional symbol <CODE>std</CODE> precedes the position values, then the
numbers are relative positions in a file image that is assumed to be a
grid of images all the same size.  It is also assumed that images are
separated by two pixels on all sides, so the pixel position is <CODE>2 +
(x * (img_width + 2))</CODE>.

</P>
<P>
File images do not have explicit masks, but may instead have key colors
that will be used to compute the mask.  Key colors are indicated by 2x2
pixel blocks in the upper left corner of the file image.  Any number of
key colors may be defined; the end of the list is indicated by a block
of the same color as the first block.  (See <TT>`images/river44x48.gif'</TT>
for an example with many key colors.)

</P>
<P>
<U>Symbol:</U> <B><CODE>std</CODE></B><P>
<A NAME="IDX1008"></A>
This symbol, when in a <CODE>file</CODE> property, indicates that the
file image is laid out in a standard grid pattern. (see above)

</P>
<P>
Note that for the purposes of stability and change tracking, tools that
generate image families use a more restricted format.  This format
requires a separate imf form for each size of image, the size is on the
same line as the imf name, and each image/mask is on a separate line,
indented by 2. (See the existing library imf files for further detail.)

</P>

<HR>
Go to the <A HREF="xcdesign_1.html">first</A>, <A HREF="xcdesign_54.html">previous</A>, <A HREF="xcdesign_56.html">next</A>, <A HREF="xcdesign_61.html">last</A> section, <A HREF="xcdesign_toc.html">table of contents</A>.
</BODY>
</HTML>