02-19-2025, 06:42 AM
@Pete your code gives me headaches. It's the old school style of programming with single variable names and things not being declared and arrrghhh!!!
Explain a few things to me:
You only make Overlay once in the program. Right?
And at no point do you ever CLS the Overlay?
And yet, you draw on this same Overlay a bazillion times...
When does those drawings ever get erased? Do they ever get erased? If they don't get erased, then why are you redrawing them repeatedly?
Look as I might, I just don't see where that screen is ever getting cleared or erased.
What am I overlooking here? All this seems to be one overly complex way to do things to me.
Why not go with a much simpler approach like:
TYPE button_type
handle as LONG
wide as LONG
tall as LONG
END TYPE
REDIM button(0) AS button_type
Then when you assign button$(k) = "whatever the caption might be", you instead:
temp = _newimage(8, 16 * "whatever the caption might be" , 32)
_DEST temp
CLS ,whatever_background_color_wanted
Lines 'draw the border as wanted
LOCATE 1, 1: PRINT button$(k); 'print the caption
button(index).handle = _COPYIMAGE(temp, 33) 'make a copy of the button in hardware
button(index).wide = 16 * "whatever the caption might be"
button(index).tall = 8 'or _FONTHEIGHT
_FREEIMAGE temp
Now you have that hardware image already created of that button. You don't have to recreate it over and over. You don't need to PRINT the caption back on the screen or anything else. You just _PUTIMAGE that already created button on the screen where you want it, and be done with it.
Note that this also has the added effect of making each button the size of a button and not just a drawing on the whole screen. You're not going for an overlay of the whole screen; you're just making a button to display over the screen where needed.
Explain a few things to me:
You only make Overlay once in the program. Right?
And at no point do you ever CLS the Overlay?
And yet, you draw on this same Overlay a bazillion times...
Code: (Select All)
Color fb.BHybFg, fb.BHybBg2
Locate y1(q) + 1, x1(q) + 1: Print button$(l);
_Dest overlay
Line (8 * (x(k) - 1) + 2, 16 * (y(k) - 1) + 7 + 2)-((j + 2) * 8 + 8 * (x(k) - 1) - 2, 16 * 2 + 16 * (y(k) - 1) + 7 - 2), _RGB32(0, 155, 155), B
Overlay_Hardware = _CopyImage(overlay, 33)
_PutImage (0, 0), Overlay_Hardware
_FreeImage Overlay_Hardware
_Dest 0
When does those drawings ever get erased? Do they ever get erased? If they don't get erased, then why are you redrawing them repeatedly?
Look as I might, I just don't see where that screen is ever getting cleared or erased.
What am I overlooking here? All this seems to be one overly complex way to do things to me.
Why not go with a much simpler approach like:
TYPE button_type
handle as LONG
wide as LONG
tall as LONG
END TYPE
REDIM button(0) AS button_type
Then when you assign button$(k) = "whatever the caption might be", you instead:
temp = _newimage(8, 16 * "whatever the caption might be" , 32)
_DEST temp
CLS ,whatever_background_color_wanted
Lines 'draw the border as wanted
LOCATE 1, 1: PRINT button$(k); 'print the caption
button(index).handle = _COPYIMAGE(temp, 33) 'make a copy of the button in hardware
button(index).wide = 16 * "whatever the caption might be"
button(index).tall = 8 'or _FONTHEIGHT
_FREEIMAGE temp
Now you have that hardware image already created of that button. You don't have to recreate it over and over. You don't need to PRINT the caption back on the screen or anything else. You just _PUTIMAGE that already created button on the screen where you want it, and be done with it.
Note that this also has the added effect of making each button the size of a button and not just a drawing on the whole screen. You're not going for an overlay of the whole screen; you're just making a button to display over the screen where needed.