world.TextRectangle
Specifies the size of the rectangle in which text is displayed in the output window.
Prototype
long TextRectangle(long Left, long Top, long Right, long Bottom, long BorderOffset, long BorderColour, long BorderWidth, long OutsideFillColour, long OutsideFillStyle);
Description
This reduces the rectangle in which normal MUD output is displayed, from the entire output window, to the subset specified.
This can be used to make a "desktop effect" where you have room on all sides for miniwindows to be placed.
A border can be drawn at the edge of the rectangle to make it obvious where the text ends, to help in resizing the window.
The text is clipped to be within the text rectangle. A window redraw is forced.
Left, Top, Right, Bottom - describes the rectangle in which the text is drawn. If 0,0,0,0 is specified, text is drawn "normally" to the borders of the output window.
BorderOffset - the offset in pixels between the edge of the text, and the border. You can specify a few pixels here so that the text is not jammed up against the border.
BorderColour - the colour to draw the border in (RGB value).
BorderWidth - the width of the border - make zero for no border.
OutsideFillColour - the brush colour to fill the area outside the text rectangle.
OutsideFillStyle - the brush mode to use for the outside fill. See Brush parameters for a description of the various modes. The brush modes can be:
0: solid (filled with a solid colour)
1: null (not filled)
2: hatch: horizontal
3: hatch: vertical
4: hatch: forwards diagonal
5: hatch: backwards diagonal
6: hatch: cross
7: hatch: diagonal cross
8: fine pattern
9: medium pattern
10: coarse pattern
11: waves - horizontal
12: waves - vertical
Lua example
TextRectangle(50, -- left
100, -- top
50 + GetInfo (213) * 80, -- 50 + width for 80 characters
-100, -- 100 pixels from the bottom
5, -- BorderOffset,
ColourNameToRGB ("gray"), -- BorderColour,
2, -- BorderWidth,
ColourNameToRGB ("silver"), -- OutsideFillColour,
8) -- OutsideFillStyle (fine hatch)
Lua notes
You can use the following constants for the outside fill style:
miniwin.brush_solid = 0
miniwin.brush_null = 1
miniwin.brush_hatch_horizontal = 2
miniwin.brush_hatch_vertical = 3
miniwin.brush_hatch_forwards_diagonal = 4
miniwin.brush_hatch_backwards_diagonal = 5
miniwin.brush_hatch_cross = 6
miniwin.brush_hatch_cross_diagonal = 7
miniwin.brush_fine_pattern = 8
miniwin.brush_medium_pattern = 9
miniwin.brush_coarse_pattern = 10
miniwin.brush_waves_horizontal = 11
miniwin.brush_waves_vertical = 12
Return value
eBrushStyleNotValid - invalid brush style specified for OutsideFillStyle
eOK - done OK
Related topic
See also
| Function | Description |
|---|---|
| Redraw | Schedules a redraw for all windows for this world |
| Repaint | Forces an immediate redraw for all windows for this world |