[futurebasic] Two more questions

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2004 : Group Archive : Group : All Groups

From: Richard Goodman <bhomme@...>
Date: Fri, 10 Dec 2004 07:53:18 -0800
I have two more questions today:

Below is a listing for a FN from ButterFlame.INCL

LOCAL FN drawCandle
'---------------------------------------
    LONG IF gCndlDestR < 2    'Is the right side of the candle going 
off screen to the left?
       CALL SETRECT(gCndlDestT, 0, 0,28,222)        'Set new rect for 
a full candle
       CALL OFFSETRECT(gCndlDestT,WINDOW(_width),RND(120)+ 80)
       /* Above line places the rect at the right of the window and at 
a random height. Note that
       the height of the candle's rect isn't changed, but the rect is 
positioned so that
       part of the rect is offscreen at the bottom.
       */
        gBurnedButter = _false
    END IF
    CALL OFFSETRECT(gCndlDestT,-4,-gBkGdSrcT)
    FN copybits(gPictWorld&,gScratchWorld&,gCndlSrcT,gCndlDestT,_srcCopy)
    FN drawFlame
    CALL OFFSETRECT(gCndlDestT,0,gBkGdSrcT)
END FN
==================================

This function draws the body of the candle into the GW called gScratchWorld&.
As I understand this function, the LONG IF conditional draws a new 
candle when the old one is about to move off the screen. My question 
has to do with the two OFFSETRECTS after the END IF. I think the 
first call to OFFSETRECT is responsible for the apparent movement of 
the candle to the left as the butterfly flies to the right. However, 
I don't understand the vertical offset -gBkGdSrcT. That seems to me 
to move the candle's rect upwards the height of the background rect. 
Then, in the last line, the candle's rect is offset back down the 
same amount.

Question 1)  Why is this vertical displacement necessary.
.....................................................................................
Question 2)  Would someone refresh my memory as to the meaning of two 
dots, as in the expression below:

DIM resHndl AS ..Picture

I can't find an explanation in the reference manual.

Thanks.

-- 
Richard le bon homme
--
To unsubscribe, send ANY message to: futurebasic-unsubscribe@...