[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.TextRectangle


Name TextRectangle
Type Method
Summary 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);

View list of data type meanings

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


Note: Available in version 4.35 onwards.


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
Returns eBrushStyleNotValid - invalid brush style specified for OutsideFillStyle

eOK - done OK

View list of return code meanings

Introduced in version 4.35

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

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]