GFGumpPic( x, y,
gumpid ) |
Purpose |
Displays a graphic from the "Gumps" section of the InsideUO program
on the screen. |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
gumppic |
ID of the graphic to use (taken from InsideUO) |
Return Value |
A structure...
|
- Layout-array index changed
|
|
Notes |
Can be used as a background gump or a control-graphic.Graphic
is placed relative to current origin as set by the GFSetRef( ) function. |
GFResizePic( x, y,
gumpid, w, h ) |
Purpose |
Displays a complex graphic, from the "Gumps" section of the InsideUO program,
on the screen by building up the 9 consecutive graphics from #(gumpid) to #(gumpid+8). |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
gumppic |
ID of the first of the 9 graphics to use (taken from InsideUO) |
w |
Total width of the resulting complex-graphic. |
h |
Total height (down the screen) of the resulting complex-graphic. |
Return Value |
A structure...
|
- Layout-array index changed
|
|
Notes |
This is usually used to make up the background graphics for the large majority of Gumps. |
GFTilePic( x, y,
tileid ) |
Purpose |
Displays a graphic from the "Artwork / Static Tiles" section of the InsideUO program
on the screen. |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
tileid |
ID of the graphic to use (taken from InsideUO) |
Return Value |
A structure...
|
- Layout-array index changed
|
|
Notes |
TilePics differ from GumpPics and
Resizables in that they use the graphics normally accessed by objects! Be careful
if you're switching between GumpPics and TilePics, especially! |
GFTextMid( x, y,
w, colour, text ) |
Purpose |
Displays a line of text, centred within the region indicated by the leftmost co-ordinates
and the width of the region, relative to the pre-specified origin and in a given colour. |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
w |
Width of the region, relative to the x
co-ordinate, given. |
colour |
Colour of text. |
text |
Text to display. |
Return Value |
A structure...
|
- Layout-array index changed
- Data-array index changed (0-based index)
|
|
Notes |
This text is static. |
GFTextRight( rx, y,
colour, text ) |
Purpose |
Displays a line of text, right aligned to a given position, in a
given colour, relative to the pre-specified origin. |
rx |
Distance of the right-most edge of the text in from the left
edge, relative to the pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
colour |
Colour of text. |
text |
Text to display. |
Return Value |
A structure...
|
- Layout-array index changed
- Data-array index changed (0-based index)
|
|
Notes |
This text is static. |
GFTextCrop( x, y,
w, h, colour, text ) |
Purpose |
Display a line of text at a given position and in a given colour,
relative to the pre-specified origin, but restricts it to a bounding box. |
x |
Distance the bounding-box is in from the left edge, relative to the
pre-specified origin. |
y |
Distance the bounding-box is down from the top edge, relative to the
pre-specified origin. |
w |
The width of the bounding box, from the x-position. |
h |
The height of the bounding box, from the y-position. |
colour |
Colour of text. |
text |
Text to display. |
Return Value |
A structure...
|
- Layout-array index changed
- Data-array index changed (0-based index)
|
|
Notes |
This text is static and shows '... ' if it exceeds
the rightmost edge of the bounding box. |
GFTextEntry( x, y,
w, h, colour, text ) |
Purpose |
Displays a line of text (optional) at a given position and
in a given colour, relative to the pre-specified origin which can then be edited by the player
and is returned via the keylist (by GFSendGump( ).) |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
w |
Width of text-entry area. |
h |
Height (downwards) of text-entry area. |
colour |
Colour of text. |
text |
Text to display. |
Return Value |
A structure...
retv.lytidx retv.dtidx retv.keyid
|
- Layout-array index changed - Data-array index changed
(0-based index)
- KeyID allocated to the text when the Gump returns
(This method is DAFT! But hey, I didn't write it! :-P" )
(Returns eg: "Key=2024, Value=2024: This is the text" )
|
|
Notes |
Only the text itself is shown... if you want a "background slot" for
it to sit in, then you must create it yourself (with GFGumpPic( ),
GFResizePic( ) or GFTilePic( ) )
Call GFExtractData( ) with the retv.keyid member to
extract only the text from the data-array. |
GFButtonPage( x, y,
release, press, page ) |
Purpose |
Displays a "button" graphic which changes the "page" that the Gump shows. |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
release |
The Gump graphic ID relating to the "released" state of the button (default position) |
press |
The Gump graphic ID relating to the "pressed in" state of the button (when the
mouse is clicked on it) |
page |
The page number that the button flicks to. |
Return Value |
A structure...
|
- Layout-array index changed
- Page number that the button changes to
|
|
Notes |
If there is no "pushed in" graphic, then supply the same ID for both release and
press. (example: book corner graphics) |
GFButtonID( x, y,
release, press, close ) |
Purpose |
Displays a "button" graphic which returns a "key value" when pressed. |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
release |
The Gump graphic ID relating to the "released" state of the button (default position) |
press |
The Gump graphic ID relating to the "pressed in" state of the button (when the
mouse is clicked on it) |
close |
Does the page close when the button's pressed? (0=No, 1=Yes) |
Return Value |
A structure...
|
- Layout-array index changed
- KeyID allocated to the button
(returned from Gump if pressed) (butid)
|
|
Notes |
If there is no "pushed in" graphic, then supply the same ID for both release and
press. (example: book corner graphics) |
GFCheckBox( x, y,
off, on, state ) |
Purpose |
Displays an on/off (yes/no) checkbox which returns its 'state' when the Gump is closed. |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
off |
The Gump graphic ID relating to the "off/no" state of the checkbox |
on |
The Gump graphic ID relating to the "on/yes" state of the checkbox |
state |
Sets the initial state of the checkbox (0=Off/No, 1=On/Yes) |
Return Value |
A structure...
|
- Layout-array index changed
- KeyID allocated to the checkbox. (cbxid)
|
|
Notes |
The state of a checkbox is only returned from the Gump if it's On/Yes; if
it's Off/No, then it's not returned. |
GFRadioButton( x, y,
off, on, state ) |
Purpose |
Displays an on/off (yes/no) radio (option) button which returns its 'state'
when the Gump is closed. |
x |
Distance in from the left edge, relative to the
pre-specified origin. |
y |
Distance down from the top edge, relative to the
pre-specified origin. |
off |
The Gump graphic ID relating to the "off/no" state of the radio-button |
on |
The Gump graphic ID relating to the "on/yes" state of the radio-button |
state |
Sets the initial state of the radio-button (0=Off/No, 1=On/Yes) |
Return Value |
A structure...
|
- Layout-array index changed
- KeyID allocated to the radio-button. (radid)
|
|
Notes |
The state of a radio button is only returned from the Gump if it's On/Yes.
Only one radio button in a group may be selected!Set up seperate groups of radio buttons with
GFSetRadioGroup( ). |
GFUser2( l_line,
d_pos, d_line ) |
Purpose |
Appends a user-specified control-line directly onto the end of the layout
array and places the other, supplied, text string into the specified location in the data array. |
l_line |
The line of command-text to append. |
d_pos |
The position in the data array to place the "text line". |
d_line |
The text-line to place in the data array. |
Return Value |
A structure...
|
- Layout-array index changed
- Data-array index changed
|
|
Notes |
This is not checked for errors! Be careful! |
Example code
Returns a '1' if you click "Okay", a '0' if you click "Cancel", or '-1' if something weird occurs.
//
// Gump which asks "Are you sure?"
//
include "include/gumps.inc";
function gump_areyousure( who )
GFInitGump();
GFNoClose();
GFSetRef( 100, 100 );
GFGumpPic( 0, 0, 0x816 );
GFTextLine( 38, 33, 55, "Are you sure?" );
var okay := GFButtonID( 35, 72, 0x81c, 0x81b, 1 );
var cancel := GFButtonID( 85, 72, 0x819, 0x818, 1 );
var retv := GFSendGump( who );
if ( retv[0] == okay.keyid )
return 1;
elseif ( retv[0] == cancel.keyid )
return 0;
else
return -1;
endif
endfunction