Question about displaying strings
|
10-23-2019, 04:11 PM
Post: #14
|
|||
|
|||
RE: Question about displaying strings
I had a need for something like this also, here is what I ended up doing. I decided that G9 was a GROB that I don't really use so in my program I initialize G9 on startup to a size of 320x30 pixels, and then have a routine that calculates the half width of a string. The use is that I usually know the center X coordinate where I want the string to be, if I know half the width, then I simply subtract that value to get the starting point for TEXTOUT_P.
I added my method into the timer code previously shared for comparison. Because the width of a string varies based on text height, the second parameter of the routine is the text height as per the TEXTOUT_P documentation. Code: StringHalfWidth(); |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)