|
The following handler creates the actual backdrop:
on DoBackdrop me, Txtr2BeUsed
I=sprite(me.spritenum)
This script displays an alert message if an error occurs in handling the texture:
if voidp(Txtr2BeUsed) then
Alert "The specified texture is VOID."
abort
end if
This script centers the backdrop, if centering is specified:
if pMyLoc = point(-1,-1) then
pmyLoc = point((i.width/2-member(pMybackdrop).width/
2),(i.height/2-member(pMybackdrop).height/2))
end if
This script retrieves the number of the last index entry in the backdrop list for the camera:
pLastOne = i.camera.backdrop.count + 1
This script inserts the texture into the list of backdrops at the pLastOne position:
if pAddToListFlag then
i.camera.insertbackdrop(pLastOne,Txtr2BeUsed, pMyLoc, pMyRot)
else
This script inserts the texture into the list of backdrops if it is not to appear at the end of the lists:
i.camera.addbackdrop(Txtr2BeUsed, pMyLoc, pMyRot)
end if
end
The following handler rotates the backdrop:
on prepareframe me
I=sprite(me.spritenum)
If the value of pAnimRot is TRUE , then this script retrieves the current rotation value:
if pAnimRot then
r=i.camera.Backdrop[pLastOne].rotation
end if
if pAnimTxT then
createTexture(me)
end if
If the texture is animated, then this script creates a new texture on every prepareFrame event:
if pAnimRot then
t=createTexture(me)
This script applies the texture to the 3D world:
If the value of the pAnimRot variable is TRUE , this script specifies the rotation:
if pAnimRot then
i.camera.backdrop[pLastOne].rotation=r+pAnimate
end if
end
|