home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
pc
/
files
/
shared.cst
/
00041_Script_rotateBtnObject
< prev
next >
Wrap
Text File
|
1997-07-24
|
4KB
|
118 lines
--P1:Tool1: rotate btn object
property pToolRects, pNumOfRects
property pMenuCast
property argClickLocPnt
property pHiliteStartCast
property pHiliteSprite
property pQTVRsteps
global gModeManager, gQTVRobj, gActiveQTVRhandler, gActiveFunctionObj
--==============================================================
on mInit me
return (me)
end
----------------------------------------------------------------------------ò
on mSetup me
set pQTVRsteps = [[0,1,0],[-1,1,0],[-1,0,0],[-1,-1,0],[0,-1,0],[1,-1,0],[1,0,0],[1,1,0]]
end mSetup
----------------------------------------------------------------------------ò
on mSetMenuProp me, WhatMenuCast, toolrects, hiliteSprite, ActiveFunctionalty
set pWhatFunctActive = ActiveFunctionalty
set pMenuCast = WhatMenuCast
set pToolRects = toolrects
set pHiliteSprite = hiliteSprite
set pHiliteStartCast = pMenuCast + 1
set pNumOfRects = count(pToolRects)
end mSetMenuProp
----------------------------------------------------------------------------ò
on mGetToolMenuCast me
return ( pMenuCast )
end mGetToolMenuCast
----------------------------------------------------------------------------ò
on mButtonClicked me
set ClickLocPnt = the clickloc
set whatrect = mGetWhatToolRect( me, ClickLocPnt)
if (whatrect <> 0 ) then
if mGetCurrentMode( gModeManager) = #QTVR then rotateQTVR( me, whatrect, ClickLocPnt )
else if objectP(gActiveFunctionObj) then mRotate( gActiveFunctionObj, whatrect)
end if
end mButtonClicked
----------------------------------------------------------------------------ò
on mGetWhatToolRect me, argClickedPnt
-- argClickLocPnt -- mystery.... unable to use this varible name as an argument....sound FISHY director
set whatrect = 1
set found = #FALSE
repeat while (found = #FALSE)
if inside(argClickedPnt, getat(pToolRects,whatrect)) then
set found = #TRUE
set the castnum of sprite pHiliteSprite = pHiliteStartCast + whatrect - 1
updatestage
else set whatrect = whatrect + 1
if (whatrect > pNumOfRects) then set found = #NEVER
end repeat
if (found = #TRUE) then return( whatrect )
else return( 0 )
end mGetWhatToolRect
----------------------------------------------------------------------------ò
on rotateQTVR me, whatrect, argClickedPnt
if (whatrect <> 0) then
set NewCords = value("[" & mGetQTVRProps( gQTVRobj ) & "]")
set QTVRstep = getat(pQTVRsteps,whatrect)
set OverActiveRect = TRUE
set MouseLocPnt = argClickedPnt
set QTVRintialStep = QTVRstep * [8,5,0]
set NewCords = NewCords + QTVRintialStep
set NewViewStr = string(getat(NewCords,1)) & "," & string(getat(NewCords,2)) & "," & string(getat(NewCords,3))
mSwingToView( gQTVRobj, NewViewStr,"5" )
else set OverActiveRect = FALSE
set origHilite = the castnum of sprite pHiliteSprite
repeat while the mousedown
set MouseLocPnt = point(the mouseh, the mousev)
if inside(MouseLocPnt, getat(pToolRects,whatrect)) then
set the castnum of sprite pHiliteSprite = origHilite
updatestage
set NewCords = NewCords + QTVRintialStep
set NewViewStr = string(getat(NewCords,1)) & "," & string(getat(NewCords,2)) & "," & string(getat(NewCords,3))
mSwingToView( gQTVRobj, NewViewStr,"5" )
else
set the castnum of sprite pHiliteSprite = 0
updatestage
set OverActiveRect = FALSE
end if
end repeat
set the castnum of sprite pHiliteSprite = 0
end rotateQTVR
----------------------------------------------------------------------------ò
----------------------------------------------------------------------------ò