on Transform me
-- Transform all 4 vertices
if (NOT use3DWatcher) OR DWatcher_newChange then
set t = 0
set tt = 0
repeat with i = 1 to 4
set z = xFormPoint(pList[i])
if z <> 0 then
t = t + 1
tt = tt + z[3]
end if
vPList[i] = z
end repeat
if t <> 0 then
myVPos[3] = (tt / float(t))
else
myVPos[3] = -9999
end if
end if
end
on drawMe me
if debug then put "drawing 3DQuad.."
set x = 1
repeat with i = 1 to 4
if vPList[i] = 0 then set x = 0
end repeat
if x then
if DWatcher_newChange OR (NOT use3DWatcher) then
if cullBackfaces AND isBackfacing(vPList) then
sprite(mySprite).visible = false
else
set the visible of sprite the spritenum of me = true
sprite(mySprite).quad = [[vPList[1][1], vPList[1][2]],[vPList[2][1], vPList[2][2]],[vPList[3][1], vPList[3][2]],[vPList[4][1], vPList[4][2]]]
-- blending ??
end if
end if
else
set the visible of sprite the spritenum of me = false
end if
-- blending ??
end
on setMouseWithin me, scriptName
set scriptEvents = 1
deleteOne(the scriptInstanceList of sprite mySprite, me)
add(the scriptInstanceList of sprite mySprite, me)
set mouseWithinS = scriptName
end
on setMouseDown me, scriptName
set scriptEvents = 1
deleteOne(the scriptInstanceList of sprite mySprite, me)
add(the scriptInstanceList of sprite mySprite, me)
set mouseDownS = scriptName
end
on setMouseUp me, scriptName
set scriptEvents = 1
deleteOne(the scriptInstanceList of sprite mySprite, me)
add(the scriptInstanceList of sprite mySprite, me)
set mouseUpS = scriptName
end
on setMouseLeave me, scriptName
set scriptEvents = 1
deleteOne(the scriptInstanceList of sprite mySprite, me)
add(the scriptInstanceList of sprite mySprite, me)
set mouseLeaveS = scriptName
end
-- set one element of the local coordinate vertex list to the supplied argument at place "where"
-- where = integer from 1 to 4, vertex = [x,y,z,w] w typically would equal 1.0
on setVertex me, where, vertex
setAt(pList, where, vertex)
end
-- set the entire local coordinate vertex list to the supplied argument
-- vertices = [[x,y,z,w],[x,y,z,w],[x,y,z,w],[x,y,z,w]] w typically equals 1.0
on setVertices me, vertices
set pList = vertices
end
-- placeholder does nothing now
on toggleFrontFace me
end
-- flipV flips the bitmap in the quad vertically (exchanging the top vertices of the quad with
-- the bottom
on flipV me
end
-- flipH flips the bitmap in the quad horizontally (exchanging the left vertices of the quad
-- with the right
on flipH me
end
-- rotateClockwise takes either 90, 180, 270, or 360 as arguments and rotates the bitmap
-- in the quad by 90 degrees clockwise (effectively swapping the vertices in the quad
on rotateClockwise me, angle
end
on setInk me, theInk
set the ink of sprite mySprite = theInk
set myInk = theInk
end
on setBlend me, theBlend
set the ink of sprite mysprite = 32
set myInk = 32
set the blend of sprite mySprite = theBlend
set myBlend = theBlend
set origBlend = theBlend
end
on setMember me, memName
set myMember = member memName
set the member of sprite mySprite = myMember
end
on setSprite me, spriten
if scriptEvents then deleteone(the scriptInstanceList of sprite mySprite, me)
set mySprite = spriten
set the spriteNum of me = mySprite
if scriptEvents then set the scriptInstanceList of sprite mySprite = [me]
end
on getPos me
return pList
end
on getVPos me
return vPList
end
on getZPos me
-- return some composite average of all the z's
end
on mouseDown me
if mouseDownS <> EMPTY then do the text of field mouseDownS
end
on mouseUp me
if mouseUpS <> EMPTY then do the text of field mouseUpS
end
on mouseWithin me
if mouseWithinS <> EMPTY then do the text of field mouseWithinS
end
on mouseLeave me
if mouseLeaveS <> EMPTY then do the text of field mouseLeaveS
end
--------
on SetBlendChange me, mm
if depthCue_blend then
if mm = 0 then
set depthCue_blend = 0
set myBlend = origBlend
set the blend of sprite mySprite = origBlend
set the ink of sprite mySprite = origInk
set myInk = origInk
end if
else
if mm then
set the ink of sprite mySprite = 32
set myInk = 32
set depthCue_blend = 1
end if
end if
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA