![MACROMEDIA DIRECTOR MX 2004 Reference Download Page 1071](http://html1.mh-extra.com/html/macromedia/director-mx-2004/director-mx-2004_reference_6875161071.webp)
useDiffuseWithTexture
1071
Example
This toggles the alpha channel of cast member “foreground” on and off:
-- Lingo syntax
member("foreground").useAlpha = not(member("foreground").useAlpha)
// JavaScript syntax
switch(member("foreground").useAlpha) {
case 0:
member("foreground").useAlpha = 1;
break;
case 1:
member("foreground").useAlpha = 0;
break;
}
useDiffuseWithTexture
Usage
member(
whichCastmember
).shader(
whichShader
).useDiffuseWithTexture
Description
3D standard shader property; allows you to get or set whether the diffuse color is used to
modulate the texture (
TRUE
) or not (
FALSE
).
When set to
TRUE
, this property works in conjunction with the
blendFunction
and
blendConstant
properties: when
blendFunction
is set to #blend, the diffuse color is weighed
with the texture color to determine the final color. For example, if
blendFunction
is set to
#blend, and
blendConstant
is set to 100.0, the final color is the pure texture color. If we change
blendConstant
to 0.0, the final color is the diffuse color. If we change
blendConstant
to 10.0,
the final color is 10% texture color, and 90% diffuse color.
The default value for this property is
FALSE
.
All shaders have access to the
#standard
shader properties; in addition to these standard shader
properties shaders of the types
#engraver
,
#newsprint
, and
#painter
have properties unique to
their type. For more information, see
newShader
.
Example
In this example, the
shaderList
of the model MysteryBox contains six shaders. Each shader has
a texture list which contains up to eight textures. The
diffuseColor
property of the cast member
(Level2) is set to rgb(255, 0, 0). The
blendFunction
property of all six shaders is set to #blend,
and the blendConstant property of all six shaders is set to 80. This statement sets the
useDiffuseWithTexture
property of all shaders used by MysteryBox to TRUE. A little bit of
red will be blended into the surface of the model. This property is affected by the settings of the
blendFunction
,
blendFunctionList
,
blendSource
,
blendSourceList
,
blendConstant
, and
blendConstantList
properties.
member("Level2").model("MysteryBox").shaderlist.useDiffuseWith\
Texture = TRUE
See also
blendFunction
,
blendConstant
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...