![]() |
Forum Index : Microcontroller and PC projects : Inverted Text
Author | Message | ||||
RicM Regular Member ![]() Joined: 05/02/2022 Location: AustraliaPosts: 52 |
Dear Readers, Has anyone has a program to INVERT the text on the CMM2 Regards RicM |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
The 'Inverted text" option in MMBasic prints the text rotated 180 degrees. If you want a mirror image with the text reading left to right, you could reverse your strings before printing. Another option would be to use blit or sprites. A third option would be to modify a font to invert the characters. And there are probably other methods as well. Depending on what you are trying to achieve, the first option (reverse a string then print inverted) is the simplest. Jim CLS TEXT 400, 250, "Inverted Text", "LMI", 5 TEXT 400, 350, reverse("Mirrored Text"), "LMI", 5 FUNCTION reverse(txt$) AS STRING LOCAL n, rev$ FOR n = 1 TO LEN(txt$) rev$ = MID$(txt$,n,1) + rev$ NEXT n reverse = rev$ END FUNCTION edit again. Reversing the string then invert rotates each character so is not a true mirror. IT depends on your requirements. Edited 2022-07-13 13:00 by TassyJim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Using BLIT CLS TEXT 200, 300, "Mirrored Text", "lt", 5,1,RGB(RED) BLIT READ #1,200,300,350,30 BLIT WRITE #1,200,330,&B010 TEXT 200, 300, "Mirrored Text", "lt", 5,1 DO:LOOP UNTIL INKEY$<>"" VK7JH MMedit |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |