Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Handle letters dynamically
#3
Okay, I had a chance to play around with it a bit. It reminded me of something similar I did in my Halloween app. Similar, but not nearly as involved. So what I did was change the background to a bright white screen and used the Windows lucon fonts. I had to fiddle around a lot with the settings to get the hardware text looking mostly like the SCREEN 0 text. It's close and maybe it could be tweaked to exact.

One oddity I did find is that when I removed all the other printstring sub statements, it didn't print anything. What I noticed is that for some reason it requires at least (2) printstring sub statements to work. See the example code, below. Just REM out the second printstring sub call statement, leaving only the one above it, and you will see a blank screen when the program runs. I suspect that's a bug of some sort.

I'd like to spend some time working up a WP routine, either in graphics or a hybrid of sorts. I actually have made a WP hybrid, but that's just for buttons on popup windows and not for the text display, itself. Anyway, I have to consider ways of working out a process that is at least as fast was SCREEN 0 and your approach may just be the answer. There is a lot involved with scaling, underling, italicizing, colorization, and cursor shape and blinking. Of course I could always set side half a day and just learn to be an expert in Windows API programing. Dream eam eam... Dream, dream, dream...

Code: (Select All)
myfont$ = ENVIRON$("SYSTEMROOT") + "\fonts\lucon.ttf" 'Find Windows Folder Path.

DIM SHARED m_fnt(99, 199), m_trw(999), m_fntset(3), m_lasttext$
sc = _NEWIMAGE(350, 350 / 2, 32): SCREEN sc:
_SCREENMOVE _MIDDLE
_DISPLAYORDER _HARDWARE

'make background
temp = _NEWIMAGE(_WIDTH, _HEIGHT, 32): _DEST temp
FOR x = 0 TO _WIDTH: FOR y = 0 TO _HEIGHT: t = 0: PSET (x, y), _RGB32(255, 255, 255): NEXT y, x
bground = _COPYIMAGE(temp, 33): _FREEIMAGE temp

m_fontsettings "<", ">", 33
m_fontadd 1, myfont$, _RGBA32(0, 0, 0, 190), _RGBA32(255, 255, 255, 0), 0, 1500, .97, 1.26

_DEST sc
DO: _LIMIT 30

    _PUTIMAGE , bground

    m_printstring 40, 60, "<fh11><fi1>QB64 Hardware Text", 1, 0

    ' If some other second m_printstring statement isn't included like this one below, it will fail to print the message, above.
    m_printstring_center 300, "<fi1><fh16>", 0, 0 ' Eliminated the print character so nothing gets printed here.

    _DISPLAY
LOOP UNTIL _KEYDOWN(27)


'$INCLUDE: 'mfonts.bi'


Pete
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
Handle letters dynamically - by MasterGy - 03-05-2024, 07:59 PM
RE: Handle letters dynamically - by Pete - 03-05-2024, 08:21 PM
RE: Handle letters dynamically - by Pete - 03-08-2024, 10:41 PM
RE: Handle letters dynamically - by MasterGy - 03-09-2024, 06:35 PM
RE: Handle letters dynamically - by Pete - 03-10-2024, 02:17 AM
RE: Handle letters dynamically - by MasterGy - 03-10-2024, 06:12 PM
RE: Handle letters dynamically - by Pete - 03-10-2024, 07:18 PM



Users browsing this thread: 1 Guest(s)