BBC BASIC for Windows
Programming >> BBC BASIC language >> Experimenting with text size. For Help dialogs
http://bb4w.conforums.com/index.cgi?board=language&action=display&num=1484715660

Experimenting with text size. For Help dialogs
Post by michael on Jan 18th, 2017, 04:01am

This works fine on BBC4W and has a promising future in a utility I plan to make for help screens and data management.

I also plan to make a version for BBCSDL.
Code:
      PROCgraphics(1000,600)
      x%=0:y%=0:www%=0:hhh%=0:rrr%=90:ggg%=30:bbb%=10:cou%=0:cou=0
      PROCbrgb(200,200,200):CLG:REM background color of black
      PROCfrgb(0,0,0):REM foreground custom color

      REM put your program here
      MOVE 500,800
      PRINT "Get your reading glasses out. This is a test"
      PROCtype(0,5,"Hello")
      PROCtype(0,6,"How are you")
      MOVE 500,900
      PRINT "larger text"

      END

      REM minimalist graphics management. Designed for speed and palette use only
      DEF PROCgraphics(x,y)
      REM       width;height;charwidth,charheight,number of colors,character set
      VDU 23,22,x;y;6,14,16,1
      OFF
      VDU 5
      ENDPROC
      DEFPROCtype(x%,y%,what$)
      REM *FONT new times roman,size
      *FONT Arial,8
      REM *FONT Times New Roman,15
      PRINT TAB(x%,y%);what$
      *FONT
      ENDPROC
      DEF PROCfrgb(r%,g%,b%)
      COLOUR 0,r%,g%,b% : GCOL 0
      ENDPROC
      DEF PROCbrgb(br%,bg%,bb%)
      COLOUR 1,br%,bg%,bb% : GCOL 128+1
      ENDPROC
      DEF PROC
      DEFPROCresetrgb
      COLOUR 0,0,0,0 :COLOUR 1,200,0,0 :COLOUR 2,000,200,000
      COLOUR 3,200,200,000:COLOUR 4,000,000,200:COLOUR 5,200,000,200
      COLOUR 6,000,200,200:COLOUR 7,200,200,200:COLOUR 8,056,056,056
      COLOUR 9,248,056,056:COLOUR 10,056,248,056:COLOUR 11,248,248,056
      COLOUR 12,056,056,248:COLOUR 13,248,056,248:COLOUR 14,056,248,248
      COLOUR 15,248,248,248
      ENDPROC
      REM name x,y width height
      DEF PROCsavebmp(name$,x%,y%,h%,v%)
      OSCLI "SCREENSAVE """+name$+""" "+STR$(x%)+","+STR$(y%)+","+STR$(h%)+","+STR$(v%)
      ENDPROC
      REM name x,y width height
      DEF PROCloadbmp(name$,x%,y%,h%,v%)
      OSCLI "DISPLAY """+name$+""" "+STR$(x%)+","+STR$(y%)+","+STR$(h%)+","+STR$(v%)
      ENDPROC
      REM for getting the palette color from a location on the screen
      DEF PROCrgbret(x%,y%,RETURN r%,RETURN g%,RETURN b%)
      LOCAL rgb%
      rgb%=TINT(x%,y%)
      r%=rgb% AND &FF
      g%=rgb%>>8 AND &FF
      b%=rgb%>>16 AND &FF
      ENDPROC
 

Re: Experimenting with text size. For Help dialogs
Post by KenDown on Jan 19th, 2017, 10:07am

Why do you have a semi-colon after the TAB command? It might be needed with a number, but not with a string.