123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|634|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Auto-include common files, and lots of other questions

Sun, 11 May 2008, 15:27
LostUser
I used to post on the old BlitzCoder website and even upgraded to BlitzMax (which I find a bit too hard for me, or maybe I'm just being lazy).

Anyway, I found this website and have some questions most of which are from my recent re-use of Blitz2D.

1) Auto-include comon files.

Rather than me doing this;



Has anyone been able to do an auto-include? So that it recursively adds only .bb files within a folder, so that I don't have to do it, or update paths?

I've tried: include $string and even include "" + $string, but it always returns an error.

2) Bitmap Fonts.

I know you're not meant to use Window-based Fonts with B2D/Max, but I don't know how to use Bitmap fonts, especially when it comes to getting input from a user.

The closest I found is a library I found which does work, however my question is: are there any other Bitmap font loaders with more Bitmap font examples, as the one I have only comes with one Bitmap font example?

Note, that I could not upload the Bitmap for this library. But this library does work.




3) Can anyone re-post the old code for the function for handling MouseOver?

4) How do you filter incoming input so that the user can only input A-Z|a-z|0-9?

5) JQuery-like effects

Does anyone have any examples of Blitz 2D JQuery-like/Ajax-like effects?


That's all.

Thanks
Sun, 11 May 2008, 15:39
Jayenkai
0) Welcome!

1) If they're always being used, why not have one single "IncludeThem.bb" file along with the common include files, and include that.. Then in there you'd include the rest of them manually.

2) I use windows fonts all the time. What's wrong with using them!? So long as you can get yourself a nice freely downloadable font, and include it with the game, you're fine.

3) I don't know what that is!

4) When retrieving input, just go through and ensure that every character is one of those you want..


5) *shrugs*!


-=-=-
''Load, Next List!''
Sun, 11 May 2008, 17:05
JL235
I'm pretty certain automated imports is impossible in Blitz. I'm pretty certain it's a literal copy and paste with none of your real code run.
Mon, 12 May 2008, 02:23
LostUser
Hey thanks for your quick replies!

1) Auto-Include/Import.
Answer: Just include one file, and update that one manually.

Yes. I currently use what I call a "_bootstrap.bb" file, and this has all my common includes in it. It does not run anything/execute any code.

2) I always thought using Windows Fonts in games was bad practice? I'll use the Bitmap font library I have as it comes with a pre-made Bitmap font. I guess my question really was this: "How do you convert truetype fonts into Bitmap fonts, and then import/load them into Blitz Basic?"

3) It doesn't matter if you don't have the mouseover functions (it uses rectangles or something) as I'm pretty sure I have it on a CD somewhere, anywhere.

4) Thanks for your reply.

5) It doesn't matter about JQuery-like affects.
Mon, 12 May 2008, 05:30
Jayenkai
Fontgrab
Loads a .ttf font, uses one of the output style functions (you can add your own), and outputs a bitmap font.
And a test proggy, too, so you can use the loading/output functions from that.

-=-=-
''Load, Next List!''
Tue, 13 May 2008, 13:11
LostUser
Thanks a lot. I've spent a few hours going through various websites, including the old website with WWWArchive and got myself lots of Bitmap font routines.

Out of all of them, I think I've found what I'm after, a way of creating the bmp fonts and then an easy way (without me changing B2D code) of importing them back in again!

I also found juicyfont. Although it says its only been made for BMax/BPlus, I seem to be able to use it. But I haven't throughly tested it yet.

Oh, I found the mouse over now!



-----

I have a question, how do you center an image on the screen again, am I right in thinking its;



Or, is there a better way to do this?

Thanks.

Tue, 13 May 2008, 14:53
Jayenkai
Oh, that! I call that mousein!
My version is


Does exactly the same, and probably doesn't matter which you use! So, carry on!

And the image centering looks fine to me.

-=-=-
''Load, Next List!''
Wed, 14 May 2008, 05:13
Paul