lcd
Display graphics (deprecated)
Arguments
None.
Attributes
bgtransparent[int]: 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]: 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]: 0
Toggles the drawing of sprites. The message lcd consumes more memory.
turns this feature off (the default). When sprites are enabled,
idle[int]: 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]: 1
Common Box Attributes
annotation[symbol]
Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.
background[int]: 0
Adds or removes the object from the patcher's background layer.
adds the object to the background layer, removes it. Objects in the background layer are shown behind all objects in the default foreground layer.
color[4 floats]
Sets the color for the object box outline.
fontface[int]
Sets the type style used by the object. The options are:
plain
bold
italic
bold italic
Possible values:
0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'
fontname[symbol]
Sets the object's font.
fontsize[float]
Sets the object's font size (in points).
Possible values:
'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'
hint[symbol]
Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.
ignoreclick[int]: 0
Toggles whether an object ignores mouse clicks in a locked patcher.
jspainterfile[symbol]
You can override the default appearance of a user interface object by assigning a JavaScript file with code for painting the object. The file must be in the search path.
patching_rect[4 floats]: 0. 0. 100. 0.
Sets the position and size of the object in the patcher window.
position[2 floats]
write-only
Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.
presentation[int]: 0
Sets whether an object belongs to the patcher's presentation.
presentation_rect[4 floats]: 0. 0. 0. 0.
Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.
rect[4 floats]
write-only
Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).
size[2 floats]
write-only
Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.
textcolor[4 floats]
Sets the color for the object's text in RGBA format.
textjustification[int]
Sets the justification for the object's text.
Possible values:
0 = 'left'
1 = 'center'
2 = 'right'
varname[symbol]
Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.
Messages
anything
refers to the backwards-compatible capitalized messages.
- arguments
[list]
ascii
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.- ascii value
[int]
backsprite
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.)- any symbol
[list]
brgb
Set the background color
- red
[int]
- green
[int]
- blue
[int]
clear
clearpicts
clearsprites
Deletes all of an lcd object's named sprites.
closesprite
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.- any symbol
[list]
color
Max color palette selections are specified by a number in the range 0 - 255. Values exceeding 255 are range-restricted using a modulus operation.
- color-id
[int]
deletepict
The word lcd object's display, the command should be followed by a message.
, followed by a symbol, deletes the named the picture from memory so that it can no longer be drawn. To remove the image from the- any symbol
[list]
deletesprite
The word
, followed by a symbol, deletes the named sprite.- any symbol
[list]
drawpict
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- arguments
[list]
drawsprite
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.- any symbol
[list]
font
The
message specifies a font ID using the font number mapping that Max 6 uses generally and a font size to select a font used when drawing text in response to a or message.- font-id
[list]
- font-size ()
[list]
framearc
Same as
except that only the unfilled outline of the arc is drawn.- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- start-angle
[degrees]
- degrees-arc
[degrees]
- red
[int]
- green
[int]
- blue
[int]
frameoval
Same as
except that only the unfilled outline of the oval is drawn.- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- red
[int]
- green
[int]
- blue
[int]
framepoly
Same as
except that only the unfilled outline of the polygon is drawn.- x/y int pairs
[list]
framerect
Same as
except that only the unfilled outline of the rectangle is drawn.- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- red
[int]
- green
[int]
- blue
[int]
frameroundrect
Same as
except that only the unfilled outline of the rounded rectangle is drawn.- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- horizontal-roundness ()
[int]
- vertical-roundness ()
[int]
- red
[int]
- green
[int]
- blue
[int]
frgb
Set the foreground (pen) color
- red ()
[int]
- green ()
[int]
- blue ()
[int]
frontsprite
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.)- any symbol
[list]
getpenloc
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- local-coordinates
[list]
getpixel
The word lcd object's display, sends a message consisting of the word followed by three numbers that specify the color of the pixel in RGB format and two additional numbers that specify the pixel offset.
, followed by two integers specifying an offset from the top left corner of the- x-offset ()
[int]
- y-offset ()
[int]
getsize
Ouputs a message from the right outlet consisting of the word lcd display area.
and two numbers which report the width and height in pixels of the
hidesprite
Disable the drawing of a named sprite
- any symbol
[list]
line
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.- x position
[int]
- y position
[int]
linesegment
The word lcd display area. A color may optionally be specified using a single number that selects a color from Max's color palette (similar to the message), or by using three additional numbers that describe an RGB value (similar to 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- x start ()
[int]
- y start ()
[int]
- x end ()
[int]
- y end ()
[int]
lineto
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.- x endpoint
[int]
- y endpoint
[int]
(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.
move
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.- x position
[int]
- y position
[int]
moveto
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- x position
[int]
- y position
[int]
oprgb
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).
- red
[int]
- green
[int]
- blue
[int]
paintarc
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.- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- start-angle
[degrees]
- degrees-arc
[degrees]
- red
[int]
- green
[int]
- blue
[int]
paintoval
The word lcd display area. A color may optionally be specified using a single number that selects a color from Max's color palette (similar to the message), or by using three additional numbers that describe an RGB value (similar to 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- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- red
[int]
- green
[int]
- blue
[int]
paintpoly
paintrect
Left, top, right and bottom positions for the rectangle are specified in pixels, relative to the top left corner of the lcd display area when painting a filled rectangle. A color may optionally be specified using a single number that selects a color from Max's color palette (similar to the message), or by using three additional numbers that describe an RGB value (similar to the message).
- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- red
[int]
- green
[int]
- blue
[int]
paintroundrect
The word lcd display area. A color may optionally be specified using a single number that selects a color from Max's color palette (similar to the message), or by using three additional numbers that describe an RGB value (similar to 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- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- horizontal-roundness ()
[int]
- vertical-roundness ()
[int]
- red
[int]
- green
[int]
- blue
[int]
penmode
The word
Copy 0
Or 1
Xor 2
Bic 3
NotCopy 4
NotOr 5
NotXor 6
NotBic 7
- transfer-mode
[list]
pensize
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.- horizontal-thickness ()
[int]
- vertical-thickness ()
[int]
readpict
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 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- filename
[list]
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
The
- arguments
[list]
scrollrect
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- left ()
[int]
- top ()
[int]
- right ()
[int]
- bottom ()
[int]
- x-offset ()
[int]
- y-offset ()
[int]
setpixel
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.- x coordinate
[int]
- y coordinate
[int]
- red
[int]
- green
[int]
- blue
[int]
size
The word lcd object window size. The Maximum size is 8192 x 8192.
, followed by two integers, changes the- horizontal-size ()
[int]
- vertical-size ()
[int]
textface
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 .- text-styles
[list]
tilepict
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- arguments
[list]
write
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.- any symbol
[list]
writepict
The word lcd display area to a PNG file.
, followed by an optional filename argument, writes the current contents of the- filename
[symbol]
Output
int
Out 3rd outlet: A
is sent out the third outlet if the mouse button is currently being held down. A is sent, otherwise.list
Out 1st outlet: When you draw in the lcd with the mouse button held down, the coordinates of the mouse position are sent out the outlet as a two-item list as the mouse moves. The numbers represent local coordinates relative to the top-left corner of lcd. 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.
list
Out 2nd outlet: If 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.
attribute is set to one, the coordinates of the mouse position are sent out the second outlet as a two-item list as the mouse moves. The numbers represent local coordinates relative to the top-left corner of thepenloc
Out 4th outlet: In response to the lcd outputs a message consisting of the word followed by two numbers representing the pen location in 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.
message,See Also
Name | Description |
---|---|
mousestate | Report the mouse information |
panel | Colored background area |