Blending Issues

Aug 7, 2012 at 12:06 AM

Hello I tried to add this system to my game and the alpha blending in your textwidget goes haywire and shows these boxes around the text. Here is a picture:

Would you have any idea what is causing it because I would really love to use this system. Thanks

Im thinking the problem could be using Mercury Particles or the FarseerPhysics Engine

Aug 7, 2012 at 11:10 AM
Edited Aug 7, 2012 at 11:14 AM

It shouldn't be a conflict with MPE or Farseer as I set all of the render states internally myself before rendering anything. It looks like you're not using the correct effect for the texture format of the font you're using.

By default, a FontStyle uses premultiplied alpha and the IntensityAsAlpha_PMA effect (see FontStyle.cs, line 72), but this requires that the font texture format not be converted from what BMFont exports (which I think the default XNA settings actually do).

Can you either upload your project somewhere and I'll take a quick look, or post the Content Processer settings for the font texture and the FontStyle settings please.

Aug 7, 2012 at 4:37 PM
Edited Aug 7, 2012 at 4:39 PM

I tried some of what you said by changing the properties of the font and got mixed results. One Project worked like it should and the other didn't. Here is what I changed:


Here is my current project:

Aug 7, 2012 at 6:14 PM

Those settings are fine. The problem with your project is that you haven't used my content project in your game and instead copied the files into your own content project. For effects, this loses some of the settings; specifically the #defines I've used on some of them. If you switch back to using my content project you'll find that things will look normal again =)

Aug 8, 2012 at 12:01 AM

Wow I feel like an idiot lol. Thanks for your help. And great work with XUI. Best 2D UI Engine I have seen or used!