rect (Image)
945
rect (Image)
Usage
-- Lingo syntax
imageObjRef
.rect
// JavaScript syntax
imageObjRef
.rect;
Description
Image property. Returns a rectangle describing the size of a given image. Read-only.
The returned rectangle coordinates are given relative to the top left corner of the image.
Therefore, the left and top values of the rectangle are 0, and the right and bottom values are the
width and height of the cast member.
Example
This statement returns the rectangle of the 300 x 400 pixel member Sunrise in the
message window:
-- Lingo syntax
member("Sunrise").image.rect -- rect(0, 0, 300, 400)
// JavaScript syntax
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:
-- Lingo syntax
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
// JavaScript syntax
function showAllRects() {
var x = 1;
while(x < 51) {
var tp = member(x).type;
if (tp = "bitmap") {
trace(member(x).image.rect + " - " + member(x).name);
i++;
}
}
}
See also
height
,
image()
,
width
Содержание DIRECTOR MX 2004-DIRECTOR SCRIPTING
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...