v1.5 by Beaker 2003

Turn font smoothing on/off using the Display Properties in the Windows Control Panel. You will probably find that you will want it on when using FONText for 3D, and sometimes off for 2D.

Visit www.asciitable.com for information about the ascii character set.

Visit the on-line font browser to preview the fonts on your system.

For more information about the full version of FONText, visit the website or send an e-mail.

Font
Background
Outline
Characters
Fine-tune

HUDinclude commands

Font

Font button
Click this button to select your font, and, optionally choose a font size.

B - Bold button
Click here to make the current font bold.

I - Italic button
Make the current font italic.

U - Underline button
Click here to underline the current font.

Left justify
Click to left justify each character to its bounding block.

Trim (for 2D)
Trims each character edge so that it looks neater when drawn using 2D commands.

Pack (for 3D)
Packs each character horizontally to maximise texture space. Mostly used for 3D text.

Trim block (for 3D)
This can be useful when your character draw right to edge of the character bounding block. It will prevent characters 'bleeding' into neighbouring character blocks.

Gradient
Turn this on to get a gradual 2 tone character effect. Adjust the 2nd color by clicking the color chip.

Block size
This selects the size of character bounding block.

Autosize
Automatically chooses a suitable character size for the current bounding block size.

User gradient
You can load your own gradient image using the options menu. The image will be tiled if necessary.

 

Background

Color
Click the color chip to select the background color for the font image/texture.

Image size
Used to select the desired full image/texture size.

Zoom
Zooms the image/texture enabling a larger or smaller view. NB. This distorts the actual pixels.

Grid
Turn this on to see the edges of the character bounding blocks.

 

Outline

On
Used to turn on outlining.

Size
Sets the 'thickness' of the outline.

Color
Sets the color of the outline.

Use inverse text color
Automatically selects a suitable outline color based on the current font color.

Style
Select your outline style here. It is worth experimenting with each of these and the remaining options below to get a good idea of what is possible here.

Italic
Leans the current outline, similar to the way text leans when it is italic.

10% bigger
Make the current outline style 10 percent bigger.

Blur
Use blur to soften the current outline style. Great for creating glows, drop shadows, and other neat effects to your outline.

 

Characters

Upper
Turns on all UPPER case characters. A-Z.

Lower
Turns on all lower case characters. a-z.

Numeric
Turns on all numeric characters. 0-9.

Symbols
Turns on some of the symbols and punctuation:
!"#$%&'()*+,-./

Symbols 2
Turns on some of the symbols and punctuation:
;:<=>?@

Symbols 3
Turns on some of the symbols and punctuation: [\]^`

Full
Turns on the full set of characters (ascii). When this is selected all the above character options are disregarded.

Skip 0-32
When Full is selected (see above) this option turns off the rarely used first 33 characters (including Space).

Other
Allows you to add single characters to the final set. You can even enter words or phrases here.

 

Fine-tune

Shunt buttons
Allows you to fine-tune the positioning of the characters in your bitmap font.

x,y
Displays and allows you to type the positioning offsets for both x and y axis.

 

HUDinclude commands

GLOBAL COMMANDS

Include "HUDinclude.bb"
Essential command to include the HUD code. Should appear right at the top of your own code.



CreateHUD (camera)

Creates a HUD object, attaches it to the camera passed to it, and returns the HUD object of type HUD. Makes the current HUD this HUD.

Example of use:
myHUD.HUD = CreateHUD(cam)


CreateHUDlayer (myHUD.HUD [,z_order[,drawlayer]])
Creates a Layer object, attaches it to the passed HUD object, and returns a Layer object of type HUDlayer. You can optionally specify a z order which defaults to -99.
If you want to draw with the primitive commands to a layer then you can optionally specify that it be a drawlayer.

Examples of use:
myLayer.HUDlayer = CreateHUDlayer(myHUD)
myDrawLayer.HUDlayer = CreateHUDlayer(myHUD,-99,True)

HUDsetLayer (myLayer.HUDlayer)
Sets the current layer to use.

HUDlayerCLS (myLayer.HUDlayer)
Clears the specified layer of all visual information, much like the normal CLS command does.

HUDClearAll
Clears all HUD related media and data from memory.

 

FONT COMMANDS

HUDloadFont (font_image$)

Function that loads a bitmap font as created in FONText and returns a font object of type HUDfont.

HUDfreeFont myfont.HUDfont
Clears the specified HUD font from memory.

FontColor font, r,g,b [,alpha#]
Changes the color of the specified HUD font to the specified colors and optional alpha. Color values are between 0-255, whereas alpha is between 0-1.


ScaleFont font, x_scale#, y_scale#
Scale the specified HUD font by the specified absolute amount.


HUDsetFont font.HUDfont
Set the current font.

TEXT COMMANDS

HUDtext x#,y#,txt$ [,justify[,center_y[,space#[,spacemesh]]]]
x,y - position of the text
text$ - text to be displayed
justify - justify text: 0=left, 1=center, 2=right (default: 0)
center_y - true/false to center the text on the y axis (default: false)
space - character
spacing multiplier (default: 1)
spacemesh - create mesh quad where spaces occur (used for UI commands).

Draws some text to the current Layer object at position x,y. Text is drawn to a virtual screen with a resolution of 800 by 600.

Example of use:
HUDtext 5,55, "Hello World"


NewHUDcounter (x#,y#,txt$[,just][,cent_y][,space#])
x,y - position of counter
txt$ - text to be displayed in counter

just - justify text: 0=left, 1=center, 2=right (default: 2)

cent_y - centering on the y axis (default: false)
space - character spacing multiplier (default: 1)

Creates a Counter object on the current HUD. Counter objects have fixed spacing between characters and are best used for dynamic text that changes often, such as the score and life counters. Once created you can change the text in the Counter object with the UpdateHUDcounter command.

UpdateHUDcounter mycounter.HUDcounter, txt$
Updates a Counter object with new text. You should've already created your Counter object outside of your main loop.


HUDprint txt$
Prints the specified text to the current print layer.


HUDwrite txt$
Writes the specified text to the current print layer.

CreateCharQuad(char$)
Creates a quad mesh (4 vertices, 2 polys) and textures it with a particular letter. The function returns the handle to the mesh. This is useful for ABC particles, animated text, etc. Please note that this isn't the most efficient method for static text: use the HUDtext() command instead.


HUDtextCurve txt$,x,y,x2,y2,x3,y3, myLayer.HUDlayer [,StartWidth[,MidWidth[,EndWidth]]]
txt - text to display
x,y - position of curve start
x2,y2 - position of curve control point
x3,y3 - position of curve end
myLayer - HUD layer to display the text on
StartWidth = optional width (recommended tho) - default is 1.0
MidWidth - optional
EndWidth - optional

Displays text along a curved line.

 


IMAGE COMMANDS

HUDdrawImage texture, x#,y# [,z_order]
Draws the specified texture to the current HUD at the specified position. You can optionally set a z order for the image using the z_order parameter - which defaults to -99.

HUDscaleImage myImage.HUDimage,x_scale#,y_scale#
Scales the specified HUD image to the specified absolute scale.

HUDfreeImage myimage.HUDimage
Clears the specified image from the HUD. It also free's the texture from memory.

 

'PRIMITIVE' DRAWING COMMANDS

HUDplot x,y, myLayer.HUDlayer [,width[,height]]
Plots a point at the specified position. Replaces the normal Plot/WritePixel commands. Use sparingly.

HUDrect x,y, width,height, myLayer.HUDlayer
Draws a rectangle at the specified position. Replaces the normal Rect command.

HUDline x,y,x2,y2, myLayer.HUDlayer [,width[,char$]]
Draws a line at the specified position. Replaces the normal Line command. You can also specify a thickness and a character to texture the line/rectangle with. (To use a character you must draw the line to a layer associated with a font and not a 'draw' type layer.)

HUDcurve x0,y0,x1,y1,cpx,cpy,l.HUDlayer[,width#]
Draws a curved line starting at x0,y0 and ending at x1,y1. The control point for the curve is at cpx,cpy. The width of the line can be set with the width parameter (default is 1.0).

USER INTERFACE COMMANDS

MakeImageButton(hi.HUDimage)
Make this HUDimage clickable. Once activated with this function the image will trigger a HUDevent() when clicked. Returns the handle for the UI object. You will need this to compare with the HUDevent().

MakeTextButton(MyLayer.HUDlayer)
Make this HUDlayer clickable. Once activated with this command the layer will trigger a HUDevent() when clicked. Returns the handle for the UI object. You will need this to compare with the HUDevent().

HUDevent()
Use this function to check for any UI events. It will return the latest UI object if an event was triggered. You may want to re-write the (or create your own) HUDevent() function to match the specifics of your user interface.