world.WindowGradient
Draws a gradient in a rectangle
Prototype
long WindowGradient(BSTR WindowName, long Left, long Top, long Right, long Bottom, long StartColour, long EndColour, short Mode);
Description
Draws a gradient - that is a rectangle that gradually changes from the start colour to the end colour.
Note that changes to miniwindows will not become visible until the output window is redrawn. This happens when new (visible) lines arrive from the MUD, or if you call WindowShow, or Redraw.
Parameters:
WindowName - the name of an existing miniwindow.
Left, Top, Right, Bottom - describes the rectangle to draw into.
StartColour - the colour to start the gradient (or, see below if you are using Mode 3)
EndColour - the colour to end the gradient.
Mode - the drawing direction. One of:
1 - horizontal - left to right
2 - vertical - top to bottom
3 - make a texture by xoring the x and y columns sequentially.
For Mode 3 (make a texture) - the StartColour has 3 components, red multiplier, green multiplier, blue multiplier. These are multiplied by the generated colour to give special effects to the generated texture. For example: 0x010203 would multiply the blue component by 1, the green component by 2 and the red component by 3.
For more information, see:
http://www.gammon.com.au/mushclient/mw_shapes.htm
Lua example
WindowGradient (win, 20, 110, 160, 180,
ColourNameToRGB ("red"),
ColourNameToRGB ("yellow"),
1) -- left to right
WindowGradient (win, 20, 20, 160, 100,
ColourNameToRGB ("dodgerblue"),
ColourNameToRGB ("lightsalmon"),
2) -- top to bottom
WindowGradient (win, 0, 0, 256, 256,
0x010203,
0,
3) -- XOR texture
Lua notes
You can use the following constants for the mode:
miniwin.gradient_horizontal = 1
miniwin.gradient_vertical = 2
miniwin.gradient_texture = 3
Return value
eNoSuchWindow - no such miniwindow (either source or destination)
eUnknownOption - mode not one of the modes specified above
eOK - completed OK
Related topic
See also
| Function | Description |
|---|---|
| WindowCreate | Creates a miniwindow |
| WindowCreateImage | Creates an image in a miniwindow |
| WindowDrawImage | Draws an image into a miniwindow |
| WindowImageInfo | Returns information about an image |
| WindowImageList | Lists all images installed into a miniwindow |
| WindowImageOp | Draws an ellipse, rectangle or round rectangle, filled with an image |
| WindowLoadImage | Loads an image into a miniwindow from a disk file |