[futurebasic] Re: X-FB Happy Holidays

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

From: Al Staff <AlStaff@...>
Date: Mon, 29 Dec 1997 01:10:10 EST
I made some changes. This one should scroll more smoothly (no flash) and
should work for any text string.



WINDOW OFF

screenHeight=SYSTEM(_scrnHeight)                  ' get the height of the
current screen
screenWidth=SYSTEM(_scrnWidth)                    ' get the width of the
current screen

windowOffset=75                                ' put some value here if you
want to make a
				                                              ' window smaller than the
screen
x1=windowOffset                                   ' top left x coord of window
y1=windowOffset                                   ' top left y coord of window
x2=screenWidth-windowOffset                       ' bottom right x coord of
window
y2=screenHeight-windowOffset                      ' bottom right y coord of
window

WINDOW 1,"Screen Test",(x1,y1)-(x2,y2),_dialogFrame' draw the window
windowWidth = WINDOW(_width)                      ' get the width of the
window
windowHeight = WINDOW(_height)                    ' get the height of the
window

test$ = "Put any text here"                       ' you can put any text here
pictWidth = FN STRINGWIDTH (test$) + 1            ' width of text, x coord
pictHeight = USR FONTHEIGHT + 1                   ' height of text, y coord

Left = 0                                          ' the leftmost point in the
window
Right = windowWidth - pictWidth                   ' don't move the picture
beyond right of window
Top = pictHeight                                  ' don't move the picture
above top of window
Bottom = windowHeight                             ' don't move the picture
below bottom of window

x=50                                              ' picture starting point
inside window, x coord
y=50                                              ' picture starting point
inside window, y coord

xs=1                                              ' amount to increment the x
position
ys=1                                              ' amount to increment the y
position

myWait=20                                         ' a delay amount

LONG COLOR 0,0,0, 0                               ' set background to black
CLS

DO
 COLOR _zWhite
 PRINT %(x,y) test$;	                             ' pictWidth and pictHeight
are the size
 SCROLL (x,y - pictHeight)-(x + pictWidth, y + 5), xs,ys
 DELAY myWait
 
 x=x+xs
 y=y+ys
 
 SELECT x
  CASE Left
   xs=ABS(xs)
  CASE Right
   xs=-xs
 END SELECT
 
 SELECT y
  CASE Top
   ys=ABS(ys)
  CASE Bottom
   ys=-ys
 END SELECT
 
UNTIL FN BUTTON

' -----

Al Staffieri Jr.

AlStaff@...
http://members.aol.com/AlStaff/index.html