gumps.inc Functions |
|
GFCreateGump |
|
Parameters | |
(x:=0, y:=0, width:=0, height:=0) | |
Name | Type |
x | The X offset for drawing the gump (from upper left). |
y | The Y offset for drawing the gump (from the top). |
width | Optional - Sets the width of the gump. Can be used with GFResizePic() |
height | Optional - Sets the height of the gump. Can be used with GFResizePic() |
Explanation | |
Creates the base gump that is passed to the other functions for changing. | |
Return Values | |
Returns a struct. | |
GFClosable |
|
Parameters | |
(byref gump, bool) | |
Name | Type |
gump | Reference to the gump that will be changed. |
bool | Sets wether or not the gump can't be closed. |
Explanation | |
Sets the gump closable 1/0. Default is 1. If set to 0, the gump can not be closed by right clicking on it. |
|
Return Values | |
Returns 1 on success. Returns error on failure. |
|
GFDisposable |
|
Parameters | |
(byref gump, bool) | |
Name | Type |
gump | Reference to the gump that will be changed. |
bool | Sets wether or not the gump is disposable. |
Explanation | |
Sets the gump's dispoable setting 1/0. Default is 1. Seems to no longer have any effect. (Deprecated setting?) |
|
Return Values | |
Returns 1 on success. Returns error on failure. |
|
GFMovable |
|
Parameters | |
(byref gump, bool) | |
Name | Type |
gump | Reference to the gump that will be changed. |
bool | Sets wether or not the gump is movable. |
Explanation | |
If enabled, allows the gump to be dragged around on the user's screen. | |
Return Values | |
Returns 1 on success. Returns error on failure. |
|
GFPage |
|
Parameters | |
(byref gump, bool) | |
Name | Type |
gump | Reference to the gump that will be changed. |
page_num |
The integer representing the page's number. (page '0' is the background, always visible) |
Explanation | |
Sets the page number to write to on the gump. | |
Return Values | |
Returns 1 on success. | |
GFResizePic |
|
Parameters | |
(byref gump, x, y, gump_id, width, height) | |
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. |
gump_id | The decimal number of the gump ID to resize. |
width |
The height (pixels) of how far to scale the gump picture downwards from position X. Default is the gump's height. |
height |
The height (pixels) of how far to scale the gump picture downwards from position Y. Default is the gump's height. |
Explanation | |
Resizes a picture on a gump. Note: Only certain gump sets can be resized. See GumpInfo.cfg for IDs of known resizable pictures. |
|
Return Values | |
Returns 1 on success. | |
GFAddAlphaRegion |
|
Parameters | |
(byref gump, x, y, width, height) | |
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 width (pixels) of the transparency area from position X. |
height | The height (pixels) of the transparency area from position Y. |
Explanation | |
Adds an alpha (transparent) region to the gump. | |
Return Values | |
Returns 1 on success. | |
GFAddButton |
|
Parameters | |
(byref gump, x, y, off_id, on_id, btn_type:=GF_PAGE_BTN, btn_value:=0) | |
Name | Type |
gump | Reference to the gump that will be changed. |
x | X coordinate to place the button on. |
y | Y coordinate to place the button on. |
off_id | The default graphic of the button. |
on_id | The graphic of the button when it is clicked. |
btn_type |
The type of button to create. GF_PAGE_BTN - Will move the gump to another page. GF_CLOSE_BTN - Will close the gump and return the value of the button and other data. GF_DUMMY_BTN - Seems to do nothing but change the graphic when you click. |
btn_value |
If the button type if set to a page, it will go to the assigned page number. Otherwise, if clicked, it will return the value. If set to 0, it will assign the next available usable number. |
Explanation | |
Adds a button (page/reply) to the gump. | |
Return Values | |
Return value is the button value. | |
GFRadioButton |
|
Parameters | |
(byref gump, x, y, unp_id, pres_id, status, btn_value) | |
Name | Type |
gump | Reference to the gump that will be changed. |
x | X coordinate to place the button on. |
y | Y coordinate to place the button on. |
unp_id | The unchecked gump graphic id of the check-box. |
press_id | The checked gump graphic id of the check-box. |
status |
The radio's initial state (pressed/unpressed). 0 - Unchecked 1 - Checked |
btn_value | The value the check box will return if checked. |
Explanation | |
Adds a check-box to the gump. Notes: Check boxes can be used in a script through two ways: var input := GFSendGump(gump); //Using input.keys foreach key in (input.keys) //Do stuff here endforeach //Using arbitrary values input[btn_value]; //1 if checked. 0 if not. |
|
Return Values | |
Return value is the check box btn_value. | |
GFCheckBox |
|
Parameters | |
(byref gump, x, y, unc_id, che_id, status:=0, btn_value:=0) | |
Name | Type |
gump | Reference to the gump that will be changed. |
x | X coordinate to place the button on. |
y | Y coordinate to place the button on. |
unc_id | The unchecked gump graphic id of the check-box. |
che_id | The checked gump graphic id of the check-box. |
status |
The radio's initial state (pressed/unpressed). 0 - Unchecked 1 - Checked |
btn_value | The value the check box will return if checked. |
Explanation | |
Adds a check-box to the gump. Notes: Check boxes can be used in a script through two ways: var input := GFSendGump(gump); //Using input.keys foreach key in (input.keys) //Do stuff here endforeach //Using arbitrary values input[btn_value]; //1 if checked. 0 if not. |
|
Return Values | |
Return value is the check box btn_value. | |
GFSetRadioGroup |
|
Parameters | |
(byref gump, group_id) | |
Name | Type |
gump | Reference to the gump that will be changed. |
group_id | The number representing the group (0-9). |
Explanation | |
Adds a group-radio to the gump. Notes: Only seems to work on page 1. |
|
Return Values | |
Returns 1. | |
GFHTMLArea |
|
Parameters | |
(byref gump, x, y, width, height, text, background:=0, scrollbar:=0) | |
Name | Type |
gump | Reference to the gump that will be changed. |
x | X position (upper left) where the html area begins. |
y | Y position (upper left) where the HTML area begins. |
width | Width in pixels from position X. |
height | Height in pixels from position Y. |
text | Text to display inside the area. |
background |
0 - Background diabled (default) 1 - Background image enabled |
scrollbar |
0 - Scrollbar diabled (default) 1 - Scrollbar enabled |
Explanation | |
Adds an HTML area to the gump. | |
Return Values | |
Returns where in the data array the 'text' was placed. | |
GFAddHTMLLocalized |
|
Parameters | |
(byref gump, x, y, width, height, cliloc, background:=0, scrollbar:=0) | |
Name | Type |
gump | Reference to the gump that will be changed. |
x | X position (upper left) where the html area begins. |
y | Y position (upper left) where the HTML area begins. |
width | Width in pixels from position X. |
height | Height in pixels from position Y. |
cliloc | The cliloc-id that will call the appointed text. |
background |
0 - Background diabled (default) 1 - Background image enabled |
scrollbar |
0 - Scrollbar diabled (default) 1 - Scrollbar enabled |
Explanation | |
Adds an HTML area to the gump that uses a cliloc ID. | |
Return Values | |
Returns 1. | |
GFGumpPic |
|
Parameters | |
(byref gump, x, y, gump_id, hue := 0) | |
Name | Type |
gump | Reference to the gump that will be changed. |
x/font> | X position to place the gump picture. |
y | Y position to place the gump picture. |
gump_id | Gump ID number to draw. |
hue | Hue to use on the gump picture. |
Explanation | |
Adds a gump-image to the gump. Notes: The hue parameter is only supported by 3.5x or newer clients. |
|
Return Values | |
RETURN VALUE | |
GFTilePic |
|
Parameters | |
(byref gump, x, y, tile_id, hue := 0) | |
Name | Type |
gump | Reference to the gump that will be changed. |
x/font> | X position to place the tile picture. |
y | Y position to place the tile picture. |
gump_id | Tile ID number to draw. |
hue | Hue to use on the tile picture. |
Explanation | |
Adds a tile-image (normal item artwork) to the gump. Notes: The hue parameter is only supported by 3.5x or newer clients. |
|
Return Values | |
RETURN VALUE | |
GFTextLine |
|
Parameters | |
(byref gump, x, y, hue:=0, text:="") | |
Name | Type |
gump | Reference to the gump that will be changed. |
x | X position to draw the text. |
y | Y position to draw the text. |
hue | Hue number for the text color. |
text | The line of text to display. |
Explanation | |
Adds a text label to the gump. | |
Return Values | |
Returns where in the data array the 'text' was placed. | |
GFTextCrop |
|
Parameters | |
(byref gump, x, y, width, height, hue:=0, text:="") | |
Name | Type |
gump | Reference to the gump that will be changed. |
x | X position to draw the text. |
y | Y position to draw the text. |
width | Maximum width in pixels before the text is removed and turned into "...". |
y | Maximum height in pixels for the text (seems to have no effect). |
hue | Hue number for the text color. |
text | The line of text to display. |
Explanation | |
Adds a text cropped-label to the gump. | |
Return Values | |
Returns where in the data array the 'text' was placed. | |
GFTextEntry |
|
Parameters | |
(byref gump, x, y, width, height, txt_color, ini_text) | |
Name | Type |
gump | Reference to the gump that will be changed. |
x | X position (upper left) where the text line begins. |
y | Y position (upper left) where the text line begins. |
width | Width in pixels from position X. |
height | Height in pixels from position Y (usually 20). |
hue | Hue ID (color) of the text. |
ini_text | Default text to show. |
txt_id | The location of the text entry's input data in the data array. Default is the end of the array. |
Explanation | |
Adds a text-entry to the gump. Notes: Use GFExtractData() in gumps_ex.inc to easily remove the leading "#: " |
|
Return Values | |
Where in the data array the text is located at. | |
GFSendGump |
|
Parameters | |
(who, byref gump) | |
Name | Type |
who | Mobile to send the gump to. |
gump | Reference to the gump that will be sent. |
Explanation | |
Sends the gump to the character specified. | |
Return Values | |
The data from uo.em :: SendDialogGump(). | |