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

MUSHclient scripting

Description of MUSHclient world function: world.WindowGradient


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

View list of data type meanings

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


Note: Available in version 4.35 onwards.


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
Returns eNoSuchWindow - no such miniwindow (either source or destination)

eUnknownOption - mode not one of the modes specified above

eOK - completed OK

View list of return code meanings

Introduced in version 4.35

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

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]