' text$ is the text to save DIM txtmatrix(LEN(textin$) * 9, 13) ' we must dim the matrix to keep it in memory LOCATE 1, 1: PRINT text$ ' the text is printed on the screen so that it can be saved. If the text you want to save ' is already there, you can remove this line ! FOR i = 0 TO LEN(textin$) * 8 ' in screen 9, the characters width is 8 FOR j = 1 TO 13 ' in screen 9, the characters height is a little less than 13, ' but if the text is ' already modified (with underlining, for example), the best thing to do is to reserve ' more memory for the matrix txtmatrix(i, j) = POINT(i, j) ' here is the way to save each dot of the text in the matrix. NEXT j, iNow that your text is saved, you can modify it ! For example, to flip the text horizontaly, add this code after saving the text matrix :
FOR i = 630 TO 630 - (LEN(textin$) * 8) STEP -1 ' we must start from the right of the screen (640*350 in screen 9) FOR j = 1 TO 13 IF txtmatrix((630 - i), j) <> 0 THEN PSET (i, j), txtmatrix((630 - i), j) ' I add the test because on slow computers, the program printed the black dots too and it ' was a waste of time ! NEXT j, iTo flip the text vertically, you can draw a separation line using this line of code :
LINE (0, 14)-(LEN(textin$) * 8, 14)To flip the text, that's the same sub as previously but now J is reversed, not I. So you must use that sub :
FOR i = 1 TO LEN(textin$) * 8 FOR j = 14 TO 1 STEP -1 IF txtmatrix(i, 14 - j) <> 0 THEN PSET (i, j + 14), txtmatrix(i, 14 - j) NEXT j, iAnd if you want to create a nice effect on the vertical flipping, transform the third line of code to the following :
IF txtmatrix(i, 14 - j) <> 0 THEN PSET (i + j, j + 14), txtmatrix(i, 14 - j)so that the text is inclined.
© Copyright 1999-2000 The QB Times.
This tutorial was taken from The QB Times with permission from the webmaster(s) of the site. You may not take this article and place it on any other website.