[futurebasic] Center text at top

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2009 : Group Archive : Group : All Groups

From: Brian Heibert <heibert@...>
Date: Sun, 25 Oct 2009 13:46:46 -0400
I am using this to center text in a fullscreen window
however it puts it in the exact center of the window
where as I want to put it in the top of the window
however centered not to the left

So how would I modify this?

LOCAL FN CenterText (txt$)
DIM x,y
DIM fontSize
x = WINDOW(_width)
y = WINDOW(_height)
fontsize = 24

TEXTSIZE (fontsize)

x = x - FN STRINGWIDTH(txt$)
x = x / 2
y = y - fontSize
y = y / 2

MOVETO (x, y)
COLOR=_zWhite
PRINT txt$
END FN

Brian