The stick2xyz Documentation 1.14.1
The Basic Text File Format

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.


Basic Text File Format Table of Contents

  1. Basic Text File Restrictions
  2. Basic Input File Header
  3. Basic Input File Pane2D Block

    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. draw90triangle

    f. fill90triangle

    f. outputpane

    f. clearpane

    g. Pane 2-D Example


Basic Text File Restrictions

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.

Basic Input File Header

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

Basic Input File Pane2D Block

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

texturegray

This keyword creates a texture with a background of the indicated grayscale value in 8 bits.

Note
A keyword asking for a texture ID number can have the texture ID set to zero for black background. Texture IDs start at one.

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

texturergb

This keyword creates a texture with a background of the indicated RGB value in 8 bits.

Note
A keyword asking for a texture ID number can have the texture ID set to zero for black background. Texture IDs start at one.

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.

drawpixel

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

drawline

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

drawcircle

This keyword draws a circle onto the 2-D Pane.

d = The density of the circle's lines.

Bug:
Densities greater than one (1) do not come out as a circle.

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

fillcircle

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

drawellipse

This keyword draws an ellipse onto the 2-D Pane.

d = The density of the circle's lines.

Bug:
Densities greater than one (1) do not come out as an ellipse.

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

fillellipse

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

drawrect

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

fillrect

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

drawsquare

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

fillsquare

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

drawtriangle

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

filltriangle

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

draw90triangle

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

fill90triangle

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

outputpane

This keyword asks the program to run the pane through an output module. No parameters are currently required.

outputpane

clearpane

This keyword asks the program to clear the pane. No parameters are required.

clearpane

Pane 2-D Example

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

SourceForge.net Logo  stick2xyz Project Page