User Guide
352
This property can have an integer value from negative 2 billion to positive 2 billion. Larger
numbers cause the sprite to appear in front of sprites with smaller numbers. If two sprites have the
same
locZ value, the channel number then takes precedence for deciding the final display order
of those two sprites. This means sprites in lower numbered channels appear behind sprites in
higher numbered channels even when the
locZ values are equal.
By default, each sprite has a
locZ value equal to it’s own channel number.
Layer-dependent operations such as hit detection and mouse events obey sprites’
locZ values, so
changing a sprite’s
locZ value can make the sprite partially or completely obscured by other
sprites and the user may be unable to click on the sprite.
Other Director functions do not follow the
locZ ordering of sprites. Generated events still begin
with channel 1 and increase consecutively from there, regardless of the sprite’s Z-order.
Example
This handler uses a global variable called gHighestSprite which has been initialized in the
startMovie handler to the number of sprites used. When the sprite is clicked, its locZ is set to
gHighestSprite + 1, which moves the sprite to the foreground on the stage. Then gHighestSprite
is incremented by 1 to prepare for the next mouseUp call.
on mouseUp me
global gHighestSprite
sprite(me.spriteNum).locZ = gHighestSprite + 1
gHighestSprite = gHighestSprite + 1
end
See also
locH, locV
lod (modifier)
Syntax
member(whichCastmember).model(whichModel).lod.lodModifierProperty
Description
3D modifier; dynamically removes detail from models as they move away from the camera.
This modifier can only be added to models created outside of Director in 3D modeling programs.
The value of the
type property of the model resources used by these models is #fromFile. All
such models use detail reduction whether or not the
lod modifier is attached. Attaching the
modifier allows you to control the properties of detail reduction. The modifier cannot be added
to primitives created within Director.
The
lod modifier data is generated by 3D modeling programs for all models. Setting the
userData property "sw3d_no_lod = true" allows you to specify that the lod modifier data and
memory be released when streaming is complete.
Be careful when using the
sds and lod modifiers together, because they perform opposite
functions (the
sds modifier adds geometric detail and the lod modifier removes geometric
detail). Before adding the
sds modifier, it is recommended that you disable the lod.auto
modifier property and set the
lod.level modifier property to maximum resolution, as follows:
member("myMember").model("myModel").lod.auto = 0
member("myMember").model("myModel").lod.level = 100
member("myMember").model("myModel").addmodifier(#sds)