The layouts data are defined inside the web page containg the applet
using parameter passing
<param name="..." value="...">.
By looking at the source code of this page the layouts' data structure
can be seen. Some explanation follows:
- Each layout corresponds to a parameter which must be named
with numbers in ascending order from 1:
<param name="1" value="...">
<param name="2" value="...">
<param name="3" value="...">
...
- The value for each parameter contains pieces data. Each layout piece
contains four tokens separated by commas. Several pieces are separated by dots.
Example with 3 pieces:
<param name="1"
value="0, C, 8, FF0000. 1, B, 1, FF8800. 0, C, 8, FFFF00.">
- The meaning of the four tokens is:
- First token must be a number 0, 1, 2, 3, 4, 5 indicating which one
of the six vertices of the previous piece (hexagon) is touched by the first
vertice of this piece. 0 is OK for first piece.
This token links this piece with the previous one.
- Second token must be a letter. B represents the convex shape while
C represents the concave shape.
- Third token is a number 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 representing
one of the ten possible orientations the shape can has.
- Last token represents the color of the shape in hexadecimal format RRGGBB,
the well known Red, Green, Blue format. Example:
FF0000 is red, 880000 is dark red,
FFFF00 is yellow, 0000FF is blue, 000000 is black...
Trial and error and piece by piece additions permit to form any layout.
Remember to form stars and decagons in order something can be rotated :).
|