gumps_ex.inc Functions
 
 
Constants
The following constants are in gumps_ex.inc

Constants for GFTextCoords()
CONST ALIGN_CENTER := 0x1;
CONST ALIGN_RIGHT := 0x2;

 

GFCfgConst

Parameters
(elem_name, prop_name)
Name Type
elem_name Elem name to read from in gumpInfo.cfg
prop_name Property to retrieve from the elem selected.
Explanation
Rather than have a lot of constants at the top for different gump images, they are placed in gumpInfo.cfg and retrieved with this function. The idea is that it is easier to update gumpInfo.cfg than to recompile all scripts that use these includes.
Return Values
An integer for the gump graphical number.
 

GFExtractData

Parameters
(input, data_id)
Name Type
input The variable/information returned from GFSendGump()
data_id An index value returned by GFTextEntry().
Explanation
Retrieves the information for a text entry's data and removes the "#: " from the begining of it.
Return Values
A string containing the text entry's input value.
 

GFoptimizeGump

Parameters
(byref gump)
Name Type
gump Reference to the gump that will be changed.
Explanation
Finds duplicate page number entries and combines their information. Eliminates redundant Page # entries.
Return Values
Returns 1.
 

GFTextCoords

Parameters
(type, gump_text, x_pos, width)
Name Type
type The type of horizontal alignment to do.
ALIGN_CENTER - Aligns text between the x_pos and width position.
ALIGN_RIGHT - Aligns text so that it ends on the x_pos (width not needed).
gump_text The text to find the x coordinate for.
x_pos The x position to align the text off of.
width When center aligning the text, specify the width of the area it will fit into.
Explanation
Returns the X coordinate to pass to GFTextLine() that will align the text.
Return Values
Returns the x coordinate to place the text on.
 

GFTextMid

Parameters
(gump, x, y, width, color, text)
Name Type
gump Reference to the gump that will be changed.
x The top-left spot of the X axis.
y The top-left spot of the Y axis.
width The right-most point the text will fit into.
color Hue Id (color) of the text.
text The text that is to be displayed.
Explanation
Aligns text between the x position and width position.
Return Values
Return value is the result from GFTextLine().
 

GFTextRight

Parameters
(gump, x, y, color, text)
Name Type
gump Reference to the gump that will be changed.
x The right-most coordinate the text will end on.
y The top-left spot of the Y axis.
color Hue Id (color) of the text.
text The text to display.
Explanation
Aligns the text so that it ends on the X coordinate.
Return Values
Return value is the result from GFTextLine().
 

GFGetTextWidth

Parameters
(gump_text)
Name Type
gump_text The text to get the pixel width of.
Explanation
To figure how the width in pixels of text on a gump.
NOTE: This needs to be expanded to support fonts - and possibly be config driven?
Currently only supports font number 3 which 2x clients used.
Return Values
The width, in pixels, of the text's width on a gump.
 

GFWordWrap

Parameters
(text, pixels)
Name Type
text The text to break up.
pixels The maximum width a line of text can be.
Explanation
Breaks a string up into an array of strings. Each string will be less than or equal to 'pixels' in width.
Return Values
An array of strings.