PRINT LEN(string)

Previous topic - Next topic


Hello, brief question - at some points in my game I am positioning text elements at the center of the screen according to the length of the string. Something like PRINT string$, screenwidth/2-LEN(string$, TRUE)/2, screenheight/2. The Problem is: it seems as if the string is printed before the relative position is determined, which sometimes leads to a very brief "flickering" of the text into position. Is this supposed to happen, or am I doing something wrong?
ILI-Blocks, my first game ever - please check it out!


Some sample code would help and my test seems fine. I'm guessing maybe use variables to debug, perhaps clear the screen or try another font.
Code (glbasic) Select

GLOBAL string$ = "This is a test", screenwidth, screenheight; GETSCREENSIZE screenwidth, screenheight
PRINT string$, screenwidth/2-LEN(string$, TRUE)/2, screenheight/2