April 25, 2019, 12:45:55 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
   Home   Help Search Login Register  
Pages: [1]
Author Topic: TextBox and Font Routines - Beta Release!  (Read 2804 times)
Ancient Guru
Posts: 671

« on: May 23, 2006, 06:59:44 AM »

Download .rar (7.4kb):



Well, I couldn't make a big .a out of this and still keep the customizabilty I wanted ATM.  That won't be for a while Cheesy. You just download and compile the text_box_test.bas, and fool around for now.

Q. What is This?

A. "This" is my project thread for a TextBox and Font Routine thing I made.  Basically, you can make your own TextBox drawing routine using the variables you are given, or your own Font Drawing Routine using the variables you are given.

It's pretty neat.

Q.  Why do I have to make my own!?

A. Stfu n00b.  I have two fricken textboxes in there for you to use already, and I have one fricken standard font so quit bitchin'.

Q.  Can I have a Code Example?

A.  Let's find out:

'Start the Main Program:
    Screenres 640, 480, 32

'Create the Box and Font as Their SUB's type:
    dim shared DrawTextBox as DrawTextBox_Type
    dim shared DrawFont as DrawFont_Type

    'Choose the textbox style:
    DrawTextBox = @Standard_textbox 'Comment xor = 1 please
    'DrawTextBox = @Dotted_Textbox 'Comment xor = 1 please

    'Choose the Font routine:
    DrawFont = @Draw_Standard_Font
    dim MyFont as font
    MyFont = Create_Font(8, 8, 128, "Fonts/Default_Font.bmp")

'Make a TextBox:
    DrawTextBox(160, 120, 260, 100, rgb(35, 35, 135))
'Make Font on The Textbox:
    DrawFont(160, 120, 260, 100, "Hello!  What's up?  Not much is happening here.  Just testing my font stuff...", MyFont, 50)
'Destroy the Font at the Program's end:
    Destroy_Font myfont


Q. Why are there errors sometimes?

A.  There shouldn't be.  If there's an error, it's either: FB's fault, lack of features right now, or your fault.  I can be blamed for all of those I guess, because nothing's really documented.  Report any errors to me though, if you think there is one.

Q. Me too.

Download .rar (7.4kb):

Ancient Guru
Posts: 671

« Reply #1 on: May 23, 2006, 07:00:16 AM »


  • Images for TextBox
To Do:

  • Draw Textbox Routines on a BUFFER so it can be put trans/alpha
  • Font Editor
  • 10 - 20 Fonts/Textboxes standard with the program
  • Images for TextBoxES - Multiple textbox arrays should have multiple image arrays too.
  • Data for Fonts Option
  • Font/Text-Box Effects/Hopefully Customizable stuff too
  • Documentation
  • Change Methods to Allow .a compilation
  • Change Methods to Allow Running of Program BEHIND TextBox (Would use a text.update$)

Version PreBeta -
  • DrawBox and DrawFont are now a type, so you can do the following now:
    Dim DrawBox(0 to 5) as DrawTextBox_Type[/li][/list]
    Dim DrawFont(0 to 5) as DrawFont_Type

    DrawBox(0) = @Standard_Box
    DrawBox(1) = @Slime_Box
    DrawBox(2) = @Dotted_Box
    Etc. . .
  • The Text Detection has been updated:
    It used to keep hitting "enter" until a word no longer had enough letters to fit on one line.  Now it checks that word's length, and saves it into memory.  Until the word has been passed by the program, it ceases hitting enter.  This puts really long words that exceed the textbox on a newline, but only once.

  • Different modes for the blitting.
  • No longer delays spaces in the text.  HOW  TO  would be printed at the same speed as HOWTO
  • Added the word skip feature - I think Cheesy
  • Allow the user to optionally put in the first supported character in their font.  Will default to 0 otherwise.
  • If text went beyond a full line, the first character was being left alone while the rest of that words was promoted to the next line.  Now, the first letter is being taken as part of the group.
  • Made it so you are able to choose to wait for input if the text goes below the box.  If no input it selected, it will wait for it by default.
Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!