Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TextBox and Font Routines - Beta Release!
#1
Download .rar (7.4kb):

http://fileanchor.com/27340-d

Setup:


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 Big Grin. 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:

Code:
'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

sleep

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):

http://fileanchor.com/27340-d
Reply
#2
Updated:
  • 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$)

Changelog:

Version PreBeta -
  • DrawBox and DrawFont are now a type, so you can do the following now:
    Code:
    Dim DrawBox(0 to 5) as DrawTextBox_Type
    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:
    Quote: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 Big Grin
  • 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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)