TextRectangle
Script function

world.TextRectangle

DOC_scripting Read about scripting

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);

DOC_data_types 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



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)



Return value

eBrushStyleNotValid - invalid brush style specified for OutsideFillStyle

eOK - done OK


DOC_errors View list of return code meanings


See Also ...

Topic

DOC_miniwindows Mini Windows

Functions

FNC_GetDeviceCaps GetDeviceCaps (Gets screen device capabilities)
FNC_Redraw Redraw (Schedules a redraw for all windows for this world)
FNC_Repaint Repaint (Forces an immediate redraw for all windows for this world)
FNC_SetCursor SetCursor (Changes the shape of the mouse cursor)
FNC_WindowAddHotspot WindowAddHotspot (Adds a hotspot to a miniwindow)
FNC_WindowArc WindowArc (Draws an arc in a miniwindow)
FNC_WindowBezier WindowBezier (Draws a Bézier curve in a miniwindow)
FNC_WindowBlendImage WindowBlendImage (Blends an image into a miniwindow, using a specified blending mode)
FNC_WindowCircleOp WindowCircleOp (Draws ellipses, filled rectangles, round rectangles, chords, pies in a miniwindow)
FNC_WindowCreate WindowCreate (Creates a miniwindow)
FNC_WindowCreateImage WindowCreateImage (Creates an image in a miniwindow)
FNC_WindowDelete WindowDelete (Deletes a miniwindow)
FNC_WindowDeleteAllHotspots WindowDeleteAllHotspots (Deletes all hotspots from a miniwindow)
FNC_WindowDeleteHotspot WindowDeleteHotspot (Deletes a hotspot from a miniwindow)
FNC_WindowDragHandler WindowDragHandler (Adds a drag handler to a miniwindow hotspot)
FNC_WindowDrawImage WindowDrawImage (Draws an image into a miniwindow)
FNC_WindowDrawImageAlpha WindowDrawImageAlpha (Draws an image into a miniwindow respecting the alpha channel)
FNC_WindowFilter WindowFilter (Performs a filtering operation over part of the miniwindow.)
FNC_WindowFont WindowFont (Loads a font into a miniwindow)
FNC_WindowFontInfo WindowFontInfo (Returns information about a font)
FNC_WindowFontList WindowFontList (Lists all fonts loaded into a miniwindow)
FNC_WindowGetPixel WindowGetPixel (Gets the colour of a single pixel in a miniwindow)
FNC_WindowGradient WindowGradient (Draws a gradient in a rectangle)
FNC_WindowHotspotInfo WindowHotspotInfo (Returns information about a hotspot)
FNC_WindowHotspotList WindowHotspotList (Lists all hotspots installed into a miniwindow)
FNC_WindowHotspotTooltip WindowHotspotTooltip (Changes the tooltip text for a hotspot in a miniwindow)
FNC_WindowImageFromWindow WindowImageFromWindow (Creates an image from another miniwindow)
FNC_WindowImageInfo WindowImageInfo (Returns information about an image)
FNC_WindowImageList WindowImageList (Lists all images installed into a miniwindow)
FNC_WindowImageOp WindowImageOp (Draws an ellipse, rectangle or round rectangle, filled with an image)
FNC_WindowInfo WindowInfo (Returns information about a miniwindow)
FNC_WindowLine WindowLine (Draws a line in a miniwindow)
FNC_WindowList WindowList (Lists all miniwindows)
FNC_WindowLoadImage WindowLoadImage (Loads an image into a miniwindow from a disk file)
FNC_WindowMenu WindowMenu (Creates a pop-up menu inside a miniwindow)
FNC_WindowMergeImageAlpha WindowMergeImageAlpha (Merges an image into a miniwindow based on an alpha mask)
FNC_WindowPolygon WindowPolygon (Draws a polygon in a miniwindow)
FNC_WindowPosition WindowPosition (Moves a miniwindow)
FNC_WindowRectOp WindowRectOp (Draws a rectangle in a miniwindow)
FNC_WindowSetPixel WindowSetPixel (Sets a single pixel in a miniwindow to the specified colour)
FNC_WindowShow WindowShow (Shows or hides a miniwindow)
FNC_WindowText WindowText (Draws text into a miniwindow)
FNC_WindowTextWidth WindowTextWidth (Calculates the width of text in a miniwindow)
FNC_WindowWrite WindowWrite (Writes the contents of a miniwindow to disk as a graphics file)

(Help topic: function=TextRectangle)

DOC_contents Documentation contents page