1

Image: https://i.stack.imgur.com/53Ms1.png
I have been working with XNA some time now and this is the first time this has accured
The blacktext is supposed to say "Orc" and the purple "1 / 100" as in experience
However this does not seem to work, it seems as if the text and the backcolor are the same.

This is the drawstring code:

spritebatch.DrawString(basicFont, Player.Name, new Vector2(
                camera.Pos.X - 250, camera.Pos.Y + 85), Color.Black);
spritebatch.DrawString(basicFont, Player.curEXP.ToString() +
                " / " + Player.maxEXP, new Vector2(camera.Pos.X - 185,
                   camera.Pos.Y + 220), Color.Purple);

Basicfont:

<FontName>Kootenay</FontName>
<Size>12</Size>
<Spacing>0</Spacing>
<UseKerning>true</UseKerning>
<Style>Regular</Style>

I thought it could be because the HUD image is a little transparent so I drew some strings on the background which has the same effect.
I made a new font and the same thing happends.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
SHEePYTaGGeRNeP
  • 320
  • 3
  • 14
  • Is the Kootenay font installed on the system ? Can you try with something more common like Arial ? – prthrokz Jan 07 '13 at 16:11
  • Did you try using the Sprite Font from the Online Templates. If that doesn't work maybe you are modifying the blending function in the render? – Louis Ricci Jan 07 '13 at 16:14
  • its some error with what you set in spritebatch.begin, like alpha blending – Kikaimaru Jan 07 '13 at 16:44
  • 1
    Does your `SpriteBatch.Begin()` method include some parameters? It looks like the reason of this is alpha blending, it works weirdly when tinted with Color if non-default. Try drawing with Color.White. You might have to create pre-colored fonts if you won't be able to avoid your problem. – user1306322 Jan 07 '13 at 17:22
  • I tried Arial same problem. @LastCoder no `spritebatch.Begin(SpriteBlendMode.None, SpriteSortMode.Deferred, SaveStateMode.None, camera.viewMatrix);` – SHEePYTaGGeRNeP Jan 08 '13 at 07:48

1 Answers1

0

It worked. Thank you Kikaimaru.

I had to change SpriteBlendMode to AlphaBlend.

spritebatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred,
                   SaveStateMode.None, camera.viewMatrix);
SHEePYTaGGeRNeP
  • 320
  • 3
  • 14