SCREEN() function doesn't make nice with _FONT in graphic modes
#1
Bug 
It looks like SCREEN() function was broken in one of the updates, either that or it's not designed anymore to work in graphic modes. Particularly in 32-bit color.

Run this example:

Code: (Select All)
screen _newimage(800, 600, 32)
print "Hello"
print screen(1, 1)
print chr$(screen(1, 1))
end

Below the message it returns 219 and the solid block.

The thing is that I want to read characters from "PRINT USING" output without setting up another hidden screen for it and without creating a temporary file which causes wear and tear on the system due to the thousand calls that my program could potentially generate from it.

After being run my program kept returning an illegal function call because QB64PE doesn't seem to like neither the text coordinates given to it for SCREEN() function. It looks like one cannot set a _FONT and then call SCREEN().

Run this example:

Code: (Select All)
screen _newimage(800, 600, 32)

dim i as integer, amf as long
amf = _loadfont("/usr/share/fonts/liberation/LiberationSans-Regular.ttf", 12)
_font amf

for i = 1 to 120
    locate 4, i
    print chr$(i + 32);
    locate 5, 1
    print i; screen(4, i);
next
end

Tested on Linux; replace the _LOADFONT() line with the appropriate for MacOS or Windows. I have tried this with a monospace font, and with optional "MONOSPACE" parameter to _LOADFONT(). This doesn't even go beyond the first position.

So I guess I will have to do without "PRINT USING" formatting toward using _PRINTSTRING or _UPRINTSTRING.
Reply


Messages In This Thread
SCREEN() function doesn't make nice with _FONT in graphic modes - by mnrvovrfc - 05-21-2023, 09:23 AM



Users browsing this thread: 1 Guest(s)