Draw Lines and Boxes
- Note: standard text font 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 pixels)
- 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 is 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 a display index number of 16
- To delete all draw-box commands from cache buffer use setmenu --draw-box=
Moving and boxing 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 (not the menu screen) in the current 'standard' console text colour, you can use a built-in 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 and the screen is cleared.
title Draw Box Instantly\n Draw concentric rectangles and prompt 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.
You can write text to the screen at any Line number and Column position using echo -P:LLCC, e.g.
echo -P:0609 DOLLY
echo -P:3001 This writes to line 30, extreme left of screen.
Recommended for Easy2Boot (fastest!) - SanDisk Extreme SDCZ880-128G-G46