Qbasicnews.com
Filled in boxes - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html)
+--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html)
+--- Thread: Filled in boxes (/thread-8942.html)



Filled in boxes - Champions_2002 - 02-27-2006

How do i make boxes filled in with colour and then add some text without getting the black spaces

what i mean is this.......

Code:
line(406,11)-(633,464),0,bf
locate 4,4:print "Menu 1"



Filled in boxes - TheDarkJay - 02-27-2006

I THINK you do this

LINE (0,0)-(100,100), 12, BF
COLOR 15,12:LOCATE 1,1TongueRINT "Hello"


Filled in boxes - Antoni Gual - 02-28-2006

You can't avoid FB standard gfxlib print change the backgraound, in this it behaves exactly like QB. You have 3 options.
-PRINT changes the background to color 0, you can use PALETTE set that color to something fitting.
-Use the transparent background routine lillo suggests in the appendix of gfxlib.text in the FB distribution.
-Wait for the next 0.16 unstable release, it should include the new DRAW STRING that will allow custom fonts, custom positions and transparent background


Filled in boxes - Deleter - 02-28-2006

Quote:-Wait for the next 0.16 unstable release, it should include the new DRAW STRING that will allow custom fonts, custom positions and transparent background
haha, drawstring, :lol: I cant wait for this command, Print always annoys me Tongue


Filled in boxes - Anonymous - 02-28-2006

Code:
Type fb_FontType

    w As Integer
    h As Integer
    Data As uByte Ptr

End Type

Extern fb_FontData Alias "fb_font_8x8" As fb_FontType
'Extern fb_FontData Alias "fb_font_8x16" As fb_FontType

Sub GfxPrint( ByRef text As String, ByVal x As Integer = 0, ByVal y As Integer = 0, ByVal col As Integer = 15, ByVal buffer As Any Ptr = 0 )

  '' everyone knows angelo wrote a lot of this :)
  '' i try to optimize


    Dim row As Integer, i As Integer
    Dim bits As uByte Ptr
  
  Dim As Integer h_opt = fb_FontData.h-1, h_opt2
  
  Select Case fb_FontData.h
  
    Case 8
  
      h_opt2 = 3
      
    Case 16
    
      h_opt2 = 4
      
  End Select
  
  
    For i = 0 To Len(text)-1

        bits = fb_FontData.Data + (text[i] Shl h_opt2)
    
    Dim As Integer y_opt = y, x_opt = x + 7
    
    
        For row = 0 To h_opt
      
            Line (x_opt, y_opt)-(x, y_opt),col,, *bits Shl 8

            y_opt += 1
            bits += 1

        Next row

        x += 8

    Next i

End Sub


Screen 13
Paint( 0, 0 ), 4

gfxprint "hey hey, no black crap!"

Sleep

for now, this will work for ya. switch which one of those externs is commented to switch between 8x8 and 8x16 text