Draw graphics in a patcher window
anything | arguments [list] |
refers to the backwards-compatible capitalized messages. |
ascii | text (0 through 255) [list] |
The word | , followed by a number between 0 and 255, writes the character corresponding to that ASCII value at the current pen position, then moves the pen position to the right of that character. Numbers that exceed the 0-255 range are restricted to that range with a modulus operation.
clear | arguments [list] |
Erases the contents of lcd. |
brgb | RGB-list (0 through 255) [list] |
The word lcd object. | , followed by three numbers between 0 and 255, specify an RGB value sets the current background color of the
clearpicts | Deletes all of an lcd object's named pictures. | |
color | ColorID(0 through 255) [int] |
The word lcd. Numbers that exceed the 0-255 range are restricted to that range with a modulus operation. | , followed by a number from 0 to 255, specifies a color (from Max's color palette) for subsequent graphics drawn in
backsprite | any symbol [list] |
The word | , followed by a symbol, sets the named sprite's drawing order so that it is drawn first (and displayed last). This command can be used to alter the order in which sprites are drawn. (Normally, sprites are drawn in the order they are recorded.)
deletepict | any symbol [list] |
The word | , followed by a symbol, deletes the named picture.
deletesprite | any symbol [list] |
The word | , followed by a symbol, deletes the named sprite.
drawpict | arguments [list] |
The word lcd display area. The source rectangle is relative to the top, left corner of the picture. If not present, these rectangles are both set to be the same size as the picture. | , followed by a symbol, draws the named picture. Optionally there may follow four numbers specifying a destination rectangle in which the picture is scaled and drawn, and source rectangle that specifies the area of the picture to use in the operation. These rectangles are specified as left, top, width, and height values in pixels. The destination rectangle is relative to the top left corner of the
clearsprites | Deletes all of an lcd object's named sprites. | |
closesprite | any symbol [list] |
The word | , followed by a symbol argument that names the sprite, turns off sprite command collection and associates the defined region with the symbol. After the message, drawing commands function normally again.
drawsprite | any symbol [list] |
The word | , followed by a symbol, draws the named sprite. Optionally this may be followed by a pair of numbers that specify a horizontal and vertical offset for drawing the sprite.
font | font-ID and font-size [list] |
The word | , followed by two numbers, specifies a font ID and a font size to be used when drawing text in response to a or message. This is the same font number mapping that Max 5 uses generally.
framearc | left top right bottom start-angle (degrees) degrees-arc and color [list] |
Same as | except that only the unfilled outline of the arc is drawn.
frameoval | left top right bottom and color [list] |
Same as | except that only the unfilled outline of the oval is drawn.
framepoly | x/y-pairs and color [list] |
Same as | except that only the unfilled outline of the polygon is drawn.
framerect | left top right bottom and color [list] |
Same as | except that only the unfilled outline of the rectangle is drawn.
frameroundrect | left top right bottom horizontal/vertical-roundness and color [list] |
Same as | except that only the unfilled outline of the rounded rectangle is drawn.
frgb | RGB-list (0 through 255) [list] |
The word lcd object. | , followed by three numbers between 0 and 255, specify an RGB value sets the current foreground color of the
frontsprite | any symbol [list] |
The word | , followed by a symbol, sets the named sprite's drawing order so that it is drawn last (and displayed first). This command can be used to alter the order in which sprites are drawn. (Normally, sprites are drawn in the order they are recorded.)
hidesprite | any symbol [list] |
Turns off the drawing of a named sprite in lcd. |
getpenloc | local-coordinates [list] |
The word lcd object's right outlet. The numbers represent local coordinates relative to the top-left corner of the lcd display area. The first number is the number of pixels to the right of that corner, and the second number is the number of pixels down from that corner. | outputs a message consisting of the word followed by two numbers, out the
getsize | Ouputs a message from the right outlet consisting of the word lcd. | and two numbers which report the width and height in pixels of the|
move | horizontal and vertical-offset (pixels) [list] |
Moves the pen position a certain number of pixels down from, and to the right of, its current position. The word | must be followed by two int arguments for horizontal and vertical offset, in pixels, relative to the current pen position. Negative arguments may be used to move the pen position up or to the left.
line | horizontal and vertical-offset (pixels) [list] |
The word | , followed by two int arguments for horizontal and vertical offset, in pixels, relative to the current pen position, draws a line from the current pen position to a point determined by the specified offset, and that point becomes the new pen position. Positive arguments draw the line to the right or down; negative arguments draw up or to the left.
moveto | horizontal and vertical-offset (pixels) [list] |
Sets the pen position at which the next graphic instruction will be drawn. The lcd display area. | message must include two int arguments for horizontal and vertical offset, in pixels, relative to the upper left corner of the
lineto | horizontal and vertical-offset (pixels) [list] |
The word | , followed by two int arguments for horizontal and vertical ending point, draws a line from the current pen position to the position specified by the arguments.
linesegment | beginning and ending horizontal/vertical-offset pairs (pixels) [list] |
The word lcd display area. Optionally, a color may follow. If there is one additional int argument, the color specifies a color from Max's color palette in the same way as the message. If there are three additional int arguments, the color specifies a color as an RGB value in the same way as the message. | , followed by four int arguments that specify the endpoints of a line segment, draw a line. The numbers represent the horizontal and vertical offset of the beginning endpoint, and the horizontal and vertical offset of the finishing endpoint, in pixels, relative to the top left corner of the
(mouse) | You can draw freehand in lcd with the mouse (provided this feature has not been turned off with a local 0 message). The mouse will draw with the current pen and color characteristics, and the mouse location will be sent out the outlet. | |
oprgb | RGB-list (0 through 255) [list] |
The word If the penmode is set to 32, the alpha channel value is derived by averaging the three RGB values and mapping the average to the range 0. - 1.0 (e.g., an oprgb value of 128 128 128 would have an alpha value of .5 when the penmode is set to 32). |
, followed by three numbers between 0 and 255, specify an RGB value used as the opcolor for penmodes that support it.
paintarc | left top right bottom start-angle (degrees) degrees-arc and color [list] |
The word | , followed by six int arguments that specify the left, top, right, and bottom extremities of an oval across which the arc will be drawn, the start angle (0 is the top) and degrees of arc, paints an arc.
paintoval | left top right bottom and color [list] |
The word lcd display area. Optionally, a color may follow. If there is one additional int argument, the color specifies a color from Max's color palette in the same way as the message. If there are three additional int arguments, the color specifies a color as an RGB value in the same way as the message. | , followed by four int arguments specifying the left, top, right, and bottom extremities of an oval, paints an oval. These extremities are specified in pixels, relative to the top left corner of the
paintpoly | x/y-pairs and color [list] |
The word lcd. These x/y pairs are specified in pixels, relative to the top left corner of the lcd display area. Optionally, a color may follow the last x/y pair that is the same as the first one. If there is one additional int argument, the color specifies a color from Max's color palette in the same way as the message. If there are three additional int arguments, the color specifies a color as an RGB value in the same way as the message. | may be followed by as many as 254 int arguments that would specify a series of x/y pairs that define a polygon to be painted in
paintrect | left top right bottom and color [list] |
The word paintrect, followed by four int arguments specifying the left, top, right, and bottom positions of a rectangle, paints a rectangle. The edge positions are specified in pixels, relative to the top left corner of the lcd display area. Optionally, a color may follow. If there is one additional int argument, the color specifies a color from Max's color palette in the same way as the message. If there are three additional int arguments, the color specifies a color as an RGB value in the same way as the message. |
paintroundrect | left top right bottom horizontal/vertical-roundness and color [list] |
The word lcd display area. Optionally, a color may follow. If there is one additional int argument, the color specifies a color from Max's color palette in the same way as the message. If there are three additional int arguments, the color specifies a color as an RGB value in the same way as the message. | , followed by six int arguments specifying the left, top, right, and bottom positions of a rectangle and the amount of horizontal and vertical roundness in pixels, paints a rounded rectangle. The edge positions are specified in pixels, relative to the top left corner of the
penmode | transfer-mode (0 through 7) [list] |
The word Copy 0 Or 1 Xor 2 Bic 3 NotCopy 4 NotOr 5 NotXor 6 NotBic 7 |
, followed by a number in the range 0-7, sets the transfer mode for subsequent drawing operations. The following are transfer mode constants;
pensize | horizontal and vertical-thickness (pixels) [list] |
The word | , followed by two equal int arguments specifying horizontal and vertical thickness in pixels (e.g., 4 4), sets the current pensize. The horizontal and vertical thicknesses must be equal.
scrollrect | left top right bottom x-scroll y-scroll (pixels) [list] |
The word lcd object's display area. | , followed by six int arguments that specify the left, top, right, and bottom positions of a rectangle to be scrolled and the number of pixels to scroll in the x and y direction, scrolls a rectangle within the
setpixel | x and y coordinate pair [list] |
The word | , followed by two numbers which specify a location in local coordinates relative to the top-left corner of the lcd display area and a list of three integers in the range 0-255 which specify a color in RGB format, will set the pixel at the designated location to the selected color.
size |
horizontal (pixels) [int] vertical (pixels) [int] |
Changes the size of the lcd object. The word size must be followed by two int arguments which specify the dimensions (horizontal and vertical) in pixels of the new size. |
readpict | filename [list] |
The word lcd with the and messages. In response to the message, the object sends a message out the right outlet of the lcd object consisting of the word followed by a symbol which specifies the name of the picture file and two numbers which specify the file's width and height. If the read is unsuccessful, the error message will be sent out the right outlet. | followed by a symbol which specifies a filename, looks for a QuickTime graphic file (a file openable on Windows using the QuickTime Picture Viewer for Windows) with that name in Max's file search path, and reads the picture file from disk into RAM. This named picture can then be drawn in
recordsprite | Initiates the recording of drawing commands which will be stored in a named sprite. While recording, drawing commands will have no effect on the contents of the lcd object's window. | |
reset | arguments [list] |
Erases the contents of lcd and resets pen state to default values. The reset message is equivalent to the sequence clear pensize 1 penmode 0 frgb 0 0 0(black) brgb 255 255 255(white) moveto 0 0 |
textface | text-styles [list] |
The word | , followed by one or more names specifying text style(s), sets the font style(s) to be used when rendering text. Text style names are , , and .
tilepict | arguments [list] |
The word lcd display area. The source rectangle is relative to the top, left corner of the picture. If not present, the destination rectangle is set to the same size of lcd, and the source rectangle is set to be the same size as the picture. | , followed by a picture name argument, fills a rectangle by tiling a picture. Optionally there may follow, four numbers that specify a destination rectangle in which the picture is tiled and four numbers that specify a source rectangle that specifies the area of the picture to use in the operation. These rectangles are specified as left, top, width, and height values in pixels. The destination rectangle is relative to the top left corner of the
write | any symbol [list] |
The word | , followed by any symbol, writes that symbol beginning at the current pen position, and moves the pen position to the end of the text.
writepict | filename [symbol] |
The word lcd display area to a PNG file. | , followed by an optional filename argument, writes the current contents of the
Name | Type | g/s | Description |
---|---|---|---|
bgtransparent | int def.:0 |
Toggles background transparency. The message lcd object to transparent. When set to 1, the background of the object remains transparent until you clear it using the message. When the attribute value is set to 0 (the default) the background is initially white, consistent with earlier versions of Max. | sets the background of the|
border | int def.:1 |
The word lcd object's window, which is on by default. A message of turns this feature off. | , followed by a zero or one, toggles the drawing of a border around the|
enablesprites | int def.:0 |
Toggles the drawing of sprites. The message lcd consumes more memory. | turns this feature off (the default). When sprites are enabled,|
idle | int def.:0 |
Toggles the reporting of idle mouse position over an lcd object. The coordinates of the mouse position are sent out the middle outlet as a two-item list as the mouse moves. The numbers represent local coordinates relative to the top-left corner of the lcd display area. The first number is the number of pixels to the right of that corner, and the second number is the number of pixels down from that corner. turns off this feature, which is off by default. | |
local | int def.:1 |
Toggles drawing in the lcd with the mouse. The message turns the feature on (the default). In either case, lcd will still report the location of the mouse as it is dragged within the object's rectangle. |
Name | Description |
---|---|
mousestate | Report the status and location of the mouse |
panel | Colored background area |
Max Basic Tutorial 9: Mouse Drawing | Max Basic Tutorial 9: Mouse Drawing |