Register forum user name Search FAQ

MUSHclient scripting

Description of MUSHclient world function: world.WindowCreateImage


Name WindowCreateImage
Type Method
Summary Creates an image in a miniwindow
Prototype long WindowCreateImage(BSTR WindowName, BSTR ImageId, long Row8, long Row7, long Row6, long Row5, long Row4, long Row3, long Row2, long Row1);
Description

This creates a small image (bitmap) by specifying the bit pattern for an 8 x 8 bit image. This is primarily intended for making patterns for use with WindowImageOp, described elsewhere. By designing suitable patterns you could make grass, waves, or other landscape effects for use in maps.

WindowName - the name of an existing miniwindow.

ImageId - the image id to store this image under.

Row1, Row2, Row3, Row4, Row5, Row6, Row7, Row8 - the bit pattern for each row

The easiest way of making your own pattern is to use Lua's tonumber function and work in binary. When doing that, each '1' represents a bit that is set (and is thus in the PenColour) and each '0' represents a bit that is clear (and is thus in the BrushColour).


For more information, see:

http://www.gammon.com.au/mushclient/mw_images.htm


Note: Available in version 4.34 onwards.


Lua example
WindowCreateImage (win, "im2", 
        tonumber ("11001100", 2),  -- row 8
        tonumber ("11001100", 2),  -- row 7
        tonumber ("00110011", 2),  -- row 6
        tonumber ("00110011", 2),  -- row 5
        tonumber ("11001100", 2),  -- row 4
        tonumber ("11001100", 2),  -- row 3
        tonumber ("00110011", 2),  -- row 2
        tonumber ("00110011", 2))  -- row 1
Returns eNoSuchWindow - no such miniwindow

eOK - completed OK
Introduced in version 4.34

See also ...

Function Description
WindowCreate Creates 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]

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