Jump to content

Custom UI for the game


Shekn

Recommended Posts

Posted

v1 supports only one transparent color (the first index in the palette, typically pure green). So unless you know on what background you will display the font and that background is always the same solid color, v1 can't do what you want.

At least not by itself. How we draw them is that we take the background color, if any, and blend that to the window surface, which looks like AA, then just "burn" the foreground colored glyph on top. Like I said above, using this with BAMv2 or TTF still has some problems.

Posted

I don't understand the following. When I export normal.bam from BG2 to png, it outputs glyph images with an alpha channel. Some pixels are opaque, some are semi-transparent. The alpha values are in the range, not just 0.0 or 1.0. So it means that within the bamV1 format the image can store different values of alpha. Maybe it does not store real alpha, but something that looks like alpha. So the question is - what is it, and how is it possible to create the same bam-font as in BG2? GemRB renders these fonts without any problems.

Posted

That must be just an exporter quirk, see the transparency threshold value in options. If you open up the palette for normal.bam (or any other for that matter), you can see alpha is always set to the same opaque value. So there's no trick to v1, it's one alpha color and normal color design limited to 254 choices.

Posted

Ok, now I understand. This is a screen with Verdana Bold font rendered at 16pt. For me it looks great.

ZQRDaX4.png

I created this font as follows. Render each letter in black on a pure white background. With AA, some pixels are neither black nor white, but something in between. Next, I made each pixel of the letter image that is pure white a transparent pixel (set alpha=0). All other are graduation between black to white. Finally, save it as a png, load it into Nearinfinity and save all the glyphs as a bamV1 file. As a result the engine does a nice background blending and colouring of the font.

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...