The stick2xyz Documentation 1.14.1
|
There are a lot of variables you can put in the basic text file. However, the basic text file caries a strict format. This document will help you understand how to properly create the Basic Text File.
a. texturegray
a. texturergb
a. drawpixel
b. drawline
c. drawcircle
c. fillcircle
d. drawellipse
d. fillellipse
e. drawrect
e. fillrect
f. drawsquare
f. fillsquare
f. drawtriangle
f. filltriangle
f. outputpane
f. clearpane
The good news... the file can bear a UTF-8 header (multi-byte), or with the proper header and with UNICODE builds of stick2xyz, be a UTF-16 (wide-byte, two byte) file. The file can also be an unheadered ASCII file, which is probably what you're used to doing anyway. These advantages of the basic text file permit full internationalization of the stick2xyz package, to the best of the operating system's capabilities.
The bad news... you can probably seperate the parameters with commas (integers only). However, you can not have anything other than comments "#" spaced more than one space apart. You can not have any successive blank lines (two blank lines together). Finally, you can not have any spaces at the end of any line that is not a comment line. These restrictions permit maximum optimization of input in favor of speed.
The header below indicates this is a stick2xyz input file. It must appear at the very top of each input file. Also note that all keywords must be lowercase; stick2xyz will not attempt case sensitive matches for optimization reasons.
stick2xyz en
The use of this keyword indicates that the rest of the data in the file consists of Pane2D data. It takes two optional parameters:
x - The maximum x coordinate of the picture.
y - The maximum y coordinate of the picture.
pane2d 320 240
This keyword creates a texture with a background of the indicated grayscale value in 8 bits.
g - The gray in 0xXX or 0-255 (Required)
a - The alpha in 0xXX or 0-255 (if omitted, set to 255)
texturegray 0x80 63
This keyword creates a texture with a background of the indicated RGB value in 8 bits.
r - The red in 0xXX or 0-255 (Required)
g - The green in 0xXX or 0-255 (Required)
b - The blue in 0xXX or 0-255 (Required)
a - The alpha in 0xXX or 0-255 (if omitted, set to 255)
texturergb 0x80 64 64 255
The rest of these keywords define what to draw onto the 2-D Pane. As such, all of the below keywords are optional.
This keyword draws a pixel onto the 2-D Pane.
x = The x coordinate to draw the pixel at.
y = The y coordinate to draw the pixel at.
drawpixel 22 23
This keyword draws a line onto the 2-D Pane.
d = The density of the line.
x1 = The x coordinate to start the line at.
y1 = The y coordinate to start the line at.
x2 = The x coordinate to end the line at.
y2 = The y coordinate to end the line at.
drawline 1 1 1 10 3
This keyword draws a circle onto the 2-D Pane.
d = The density of the circle's lines.
x = The x coordinate of the circle's center.
y = The y coordinate of the circle's center.
r = The radius of the circle.
drawcircle 1 6 15 2
This keyword draws a circle onto the 2-D Pane.
t = The texture ID number to fill with.
x = The x coordinate of the circle's center.
y = The y coordinate of the circle's center.
r = The radius of the circle.
fillcircle 2 6 15 2
This keyword draws an ellipse onto the 2-D Pane.
d = The density of the circle's lines.
x = The x coordinate of the ellipse's center.
y = The y coordinate of the ellipse's center.
rx = The radius across from the center.
ry = The radius straight up from the center.
drawellipse 1 6 15 5 9
This keyword draws an ellipse onto the 2-D Pane.
t = The texture ID number to fill with.
x = The x coordinate of the ellipse's center.
y = The y coordinate of the ellipse's center.
rx = The radius across from the center.
ry = The radius straight up from the center.
fillellipse 1 6 15 5 9
This keyword draws a rectangle onto the 2-D Pane.
d = The density of the rectangle's lines.
x1 = The x coordinate of the top left of the rectangle.
y1 = The y coordinate of the top left of the rectangle.
x2 = The x coordinate of the bottom right of the rectangle.
y2 = The y coordinate of the bottom right of the rectangle.
drawrect 1 14 1 22 21
This keyword draws a rectangle onto the 2-D Pane.
t = The texture ID number to fill with.
x1 = The x coordinate of the top left of the rectangle.
y1 = The y coordinate of the top left of the rectangle.
x2 = The x coordinate of the bottom right of the rectangle.
y2 = The y coordinate of the bottom right of the rectangle.
fillrect 1 14 1 22 21
This keyword draws a square onto the 2-D Pane.
d = The density of the square's lines.
l = The length of each line to draw, in pixels.
x1 = The x coordinate of the top left of the square.
y1 = The y coordinate of the top left of the square.
drawsquare 1 4 16 3
This keyword draws a square onto the 2-D Pane.
t = The texture ID number to fill with.
l = The length of each line to draw, in pixels.
x1 = The x coordinate of the top left of the square.
y1 = The y coordinate of the top left of the square.
fillsquare 1 4 16 3
This keyword draws a triangle onto the 2-D Pane.
d = The density of the triangle's lines.
x1 = The x coordinate to the first end of the triangle.
y1 = The y coordinate to the first end of the triangle.
x2 = The x coordinate to the second end of the triangle.
y2 = The y coordinate to the second end of the triangle.
x3 = The x coordinate to the third end of the triangle.
y3 = The y coordinate to the third end of the triangle.
drawtriangle 1 50 50 75 75 100 50
This keyword draws a triangle onto the 2-D Pane.
t = The texture ID number to fill with.
x1 = The x coordinate to the first end of the triangle.
y1 = The y coordinate to the first end of the triangle.
x2 = The x coordinate to the second end of the triangle.
y2 = The y coordinate to the second end of the triangle.
x3 = The x coordinate to the third end of the triangle.
y3 = The y coordinate to the third end of the triangle.
filltriangle 1 50 50 75 75 100 50
This keyword draws a right triangle onto the 2-D Pane.
d = The density of the triangle's lines.
x1 = The x coordinate to the first end of the triangle.
y1 = The y coordinate to the first end of the triangle.
x2 = The x coordinate to the second end of the triangle.
y2 = The y coordinate to the second end of the triangle.
b = 1 if the 90 degree is to be on the top, 0 otherwise.
draw90triangle 1 50 50 75 75 100 50
This keyword draws a right triangle onto the 2-D Pane.
t = The texture ID number to fill with.
x1 = The x coordinate to the first end of the triangle.
y1 = The y coordinate to the first end of the triangle.
x2 = The x coordinate to the second end of the triangle.
y2 = The y coordinate to the second end of the triangle.
b = 1 if the 90 degree is to be on the top, 0 otherwise.
fill90triangle 1 50 50 75 75 100 50
This keyword asks the program to run the pane through an output module. No parameters are currently required.
outputpane
This keyword asks the program to clear the pane. No parameters are required.
clearpane
stick2xyz en pane2d 320 240 texturegray 0x80 63 texturergb 0x80 64 64 255 drawpixel 22 23 drawline 1 1 1 10 3 fillcircle 2 6 15 2 drawellipse 1 6 15 5 9 drawrect 1 14 1 22 21 drawsquare 1 4 16 3 filltriangle 1 50 50 75 75 100 50 draw90triangle 1 1 50 25 75 0 outputpane clearpane