home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Inventor Labs: Technology
/
INVENTORLABS_TECHNOLOGY.BIN
/
mac
/
FILES
/
TIMELN.DIR
/
00003_Script_TimeLineParent
< prev
next >
Wrap
Text File
|
1997-05-26
|
8KB
|
230 lines
--p TimeLine
-- All three sprite use
property pStartSprite, pEndSprite, pTLrectDB, pRowIndex, pRectPos
property pCurrRolloverSprite, pActiveRect, pBoxLoc, pActiveItem
-- Rollover Text
property pRolloverBoxSprite,pRolloverBoxOffset
-- click box
property pBoxActive, pBoxStartCast, pBoxSprite, pBoxOffset, pRolloverStartCast, pInvRolloverStartCast
-- text box
property pTextSpriteOffset, pTextSpriteNum, pTimelineText,pTextCast
property pInventorSym, pEdisonRollStrCst
global gUtilityObj
-----------------------------------------------------------------------------------------------------------------------
on mInit me, TLrectDB,TimelineText, RolloverStartCast, InventorSym
set pTLrectDB = value(the text of cast TLrectDB)
set pTimelineText = the text of cast TimelineText
set pRolloverStartCast = the number of cast RolloverStartCast
set pInventorSym = InventorSym
set pEdisonRollStrCst = the number of cast "TEINV1.PIC"
set pRolloverBoxOffset = point(94,61) --20
set pTextSpriteOffset = point(-80,49)
set pBoxOffset = point(0,59)
set pTextCast = the number of cast "TimeLineDisplayText"
set the textheight of field "TimeLineDisplayText" = 13
set pBoxStartCast = the number of cast "TDLBK.PIC"
-- sprites
set pStartSprite = 4
set pEndSprite = pStartSprite + 4
set pTextSpriteNum = pStartSprite + 8
set pBoxSprite = pStartSprite + 7
set pRolloverBoxSprite = pStartSprite + 6
puppetsprite pTextSpriteNum, TRUE
puppetsprite pBoxSprite, TRUE
puppetsprite pRolloverBoxSprite, TRUE
-- Initial States
set pCurrRolloverSprite = 0
set pActiveRect = 0
set pRectPos = 0
set pActiveItem = 0
set pBoxActive = FALSE
-- Rollover To Index Cast
set pRowIndex = []
set indexnum = 0
repeat with currlist in pTLrectDB
append(pRowIndex, indexnum)
set indexnum = indexnum + count(currlist)
end repeat
return( me )
end mInit
-----------------------------------------------------------------------------------------------------------------------
on mPerform me
if not pBoxActive then
set done = FALSE
if (pCurrRolloverSprite <> 0) then
if rollover(pCurrRolloverSprite) then set done = TRUE
end if
if not done then
set SpriteToCheck = pStartSprite
repeat while (not done) and (SpriteToCheck <= pEndSprite)
if rollover( SpriteToCheck ) then set done = TRUE
else set SpriteToCheck = SpriteToCheck + 1
end repeat
if done then set pCurrRolloverSprite = SpriteToCheck
else set pCurrRolloverSprite = 0
end if
if (pCurrRolloverSprite = 0) then
set pActiveRect = 0
mPlaceBox ( me, pActiveRect, 0 )
else mGetTimeRect( me, getat( pTLrectDB, pCurrRolloverSprite - pStartSprite + 1 ) )
end if
end mPerform
-----------------------------------------------------------------------------------------------------------------------
on mGetTimeRect me, RectList
set mouseloc = point(the mouseh,the mousev)
set RectFound = #FALSE
if (pActiveRect <> 0) then
if inside(mouseloc, pActiveRect) then set RectFound = #PREV
end if
if not (RectFound = #PREV) then
set pRectPos = 1
set NumOfPositions = count( RectList ) -- Linear Iteration due to time constraints: Quicksort on mouseH
repeat while ( RectFound = #FALSE) and (pRectPos <= NumOfPositions)
set PossibleRect = getat(RectList ,pRectPos)
if inside(mouseloc, PossibleRect) then
set RectFound = #TRUE
else set pRectPos = pRectPos + 1
end repeat
if (RectFound = #FALSE) then set pActiveRect = 0
else set pActiveRect = PossibleRect
mPlaceBox ( me, pActiveRect )
end if
end mGetTimeRect
-----------------------------------------------------------------------------------------------------------------------
on mPlaceBox me, RectOver
if (rectOver <> 0) then
set loch = getat(RectOver,1)
set locv = getat(RectOver,2)
if loch >= 380 then set loch = loch - 182
if locv >= 360 then set locv = locv - 111 -- Inventor
else if locv >= 300 then -- Science
set locv = locv - 111
if loch <= 380 then set loch = loch + 1
else if locv >= 220 then -- Arts
set locv = locv - 4
if loch <= 380 then set loch = loch + 1
else set loch = loch - 2
else if locv >= 170 then
if loch <= 380 then set loch = loch + 1
end if
set pBoxLoc = point(loch,locv) + pRolloverBoxOffset
set the loc of sprite pRolloverBoxSprite = pBoxLoc
if (pInventorSym = #EDISON) and ((pCurrRolloverSprite - pStartSprite) + 1) = 5 then
set pActiveItem = pRectPos - 1
set the castnum of sprite pRolloverBoxSprite = pActiveItem + pEdisonRollStrCst
else
set pActiveItem = getat(pRowIndex,(pCurrRolloverSprite - pStartSprite) + 1) + pRectPos - 1
set the castnum of sprite pRolloverBoxSprite = pActiveItem + pRolloverStartCast
end if
mSetCursors( gUtilityObj, [2:#TMLN])
else
mUnSetCursors( gUtilityObj )
set the locv of sprite pRolloverBoxSprite = -1000
end if
end mPlaceBox
----------------------------------------------------------------------------------------------------------------------
on mClick me
if pBoxActive then
set pActiveRect = 0
set pBoxActive = FALSE
set the locv of sprite pBoxSprite = -1000
set the locv of sprite pTextSpriteNum = -1000
set the locv of sprite pRolloverBoxSprite = -1000
set pCurrRolloverSprite = 0
updatestage
else if (pActiveRect <> 0) then
set the castnum of sprite pBoxSprite = pBoxStartCast + (pCurrRolloverSprite - pStartSprite)
if (pCurrRolloverSprite >= pStartSprite + 3) then
set boxoffset = point(0,98)
set the loc of sprite pRolloverBoxSprite = pBoxLoc -boxoffset
set the loc of sprite pBoxSprite = pBoxLoc + pBoxOffset - boxoffset
set the loc of sprite pTextSpriteNum = pBoxLoc + pTextSpriteOffset - boxoffset
set the loc of sprite pTextSpriteNum = pBoxLoc + pTextSpriteOffset -boxoffset
else
set the loc of sprite pBoxSprite = pBoxLoc + pBoxOffset
set the loc of sprite pTextSpriteNum = pBoxLoc + pTextSpriteOffset
end if
if (pInventorSym = #EDISON) and ((pCurrRolloverSprite - pStartSprite) + 1) = 5 then
set EdisonTempActive = pActiveItem
set pActiveItem = getat(pRowIndex,(pCurrRolloverSprite - pStartSprite) + 1) + pRectPos -- one off likely in db
end if
set whatline = (pActiveItem * 2) + 2
set pActiveItem = EdisonTempActive
set the text of cast pTextCast = line whatline to whatline of pTimelineText
set the castnum of sprite pTextSpriteNum = pTextCast
set pBoxActive = TRUE
mSetCursors( gUtilityObj, [2:#RETURN])
end if
end mClick
----------------------------------------------------------------------------------------------------------------------
on mClose me
puppetsprite pTextSpriteNum, FALSE
puppetsprite pBoxSprite, FALSE
puppetsprite pRolloverBoxSprite, FALSE
mUnSetCursors( gUtilityObj)
end mClose
-----------------------------------------------------------------------------------------------------------------------
--1790 on come up on the left
-- Science & Tech below comup on the bottom