531
Examples
This statement sets the variable
newArea
to a rectangle whose left side is at 100, top is at 150,
right side is at 300, and bottom is at 400 pixels:
set newArea = rect(100, 150, 300, 400)
The following statement sets the variable
newArea
to the rectangle defined by the points
firstPoint
and
secondPoint
. The coordinates of
firstPoint
are (100, 150); the coordinates
of
secondPoint
are (300, 400). Note that this statement creates the same rectangle as the one
created in the previous example:
put rect(firstPoint, secondPoint)
These statements add and subtract values for rectangles:
put rect(0,0,100,100) + rect(30, 55, 120, 95)
-- rect(30, 55, 220, 195)
put rect(0,0,100,100) - rect(30, 55, 120, 95)
-- rect(-30, -55, -20, 5)
This statement adds 80 to each coordinate in a rectangle:
put rect(60, 40, 120, 200) + 80
-- rect(140, 120, 200, 280)
This statement divides each coordinate in a rectangle by 3:
put rect(60, 40, 120, 200) / 3
-- rect(20, 13, 40, 66)
See also
point()
,
quad
rect (image)
Syntax
imageObject
.rect
Description
Read-only property; returns a rectangle describing the size of the given image object. The
coordinates are given relative to the top left corner of the image. The left and top values of the
rectangle are therefore always 0, and the right and bottom values are the width and height of
the cast member.
Examples
This statement returns the rectangle of the 300 x 400 pixel member Sunrise in the message
window:
put member("Sunrise").image.rect
-- rect(0, 0, 300, 400)
This Lingo looks at the first 50 cast members and displays the rectangle and name of each cast
member that is a bitmap:
on showAllRects
repeat with x = 1 to 50
if member(x).type = #bitmap then
put member(x).image.rect && "-" && member(x).name
end if
end repeat
end
See also
height
,
width
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...