Draw Lines and Boxes
- Standard text characters are 16 pixels high by 8 pixels wide
- Start position=bx,by (units in pixels)
- For an 800x600 display, bx can be 0-799 and by can be 0-599
- For a 1024x768 display, bx can be 0-1023 and by can be 0-767
- To draw a box, define both bwidth and bheight (units in pxels)
- Set bwidth to 0 to draw a vertical line
- Set bheight to 0 to draw a horizontal line
- Max 16 lines+boxes (bINDEX 1=16), Max bpixels thickness 255
- Use 16 pixels thick Horizontal lines to cover characters
- Use 8 pixels thick Vertical lines to cover characters
- Use 1-8 (max) pixels for boxes around text
- bcolor can use 0xRRGGBB values
- Avoid the menu area and do not exceed the maximum display index number
- Delete all draw-box commands from cache buffer using setmenu --draw-box=
Moving the Menu Entry Help text
set bINDEX= ;; set bx= ;; set by= ;; set bwidth= ;; set bheight= ;; set bpixels= ;; set bcolor=
set sx= ;; set sy=
Instant Boxes on grub4dos console screen
To draw any number of boxes on the 'terminal' screen in the current 'standard' console text colour, you can use an in-built grub4dos function:
#rectangle (x y w h border_width)
call Fn.77 180 180 100 100 2
#draw horizontal yellow line 4 pixels high
call Fn.77 580 380 200 4 4
This works on the current screen instantly when in graphics mode (but scrolling text may remove it).
You can use this in MyE2B.cfg or $$$$CONFIG\xx.mnu files to draw rectangles on the console screen before asking for user input.
Values are in pixels not lines. It can be called any number of times to draw multiple rectangles on the screen.
The command only affects the current display. If used in a .mnu file, you must ask for user input in order to see the rectangles before the menu is reloaded.
title Draw Box Instantly\n Draw concentric rectangles and prompy user for input
#draw horizontal yellow lines
echo -e \n\n\n\n\n\n HELLO\n\n\n\n\n\n\n\n\n
call Fn.77 0 0 200 200 4
call Fn.77 10 10 180 180 3
call Fn.77 20 20 160 160 2
call Fn.77 30 30 140 140 1
set /p ask=Is this pretty?
See Draw_Box_in_Console_Demo.mnu in \_ISO\docs\Sample mnu files\E2B Menus folder for a larger example.
Tip: To learn more about the mysterious Fn. function calls supported by grubdos, see here.
Recommended for Easy2Boot (fastest!) - SanDisk Extreme SDCZ880-128G-G46
BitCoin also accepted.