Is there an inconsistency in the Locate function? - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: Is there an inconsistency in the Locate function? (/showthread.php?tid=1699) |
Is there an inconsistency in the Locate function? - PhilOfPerth - 05-25-2023 The result of running the small snippet of code below confuses me! I would expect Locate to use the first two arguments to set the column and row for text position, but it uses the first for the vertical row position, and the second, not as the column but as a number to be determined from the font size. I know, I'm easily confused, but can someone explain this to me? PHP Code: Screen _NewImage(1280, 960, 32) RE: Is there an inconsistency in the Locate function? - SMcNeill - 05-25-2023 You're not using a monospaced font. With variable width fonts, locate positions by pixel -- not column. Add "monospace" to the loadfont statement and see the difference. RE: Is there an inconsistency in the Locate function? - PhilOfPerth - 05-25-2023 I think I get it. Thanks Steve. RE: Is there an inconsistency in the Locate function? - TempodiBasic - 05-25-2023 Great Steve, you uniformizes the dimensions of the characters of a font file! @PhiloFPerth you can get the reason here in the wiki Quote: LOCATE in _Newimage Good study! |