Jump to content
  • Advertisement
Sign in to follow this  
DrGUI

Drawing text with Effect

This topic is 4918 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I do this? I have tried but I can't identify what is causing the problem. I basically want to get the pixels through a pixel shader so I can apply a texture to the colored pixels. I could render to texture, then use this as a mask, but I don't think that's the way to go. Thanks Here is the code I render my text with:
m_ScoreSprite.Begin(Direct3D.SpriteFlags.None);
//Draw the scores
Matrix scalingM = Matrix.Scaling(scaling,scaling,scaling);
//Draw the first score
m_ScoreSprite.Transform = Matrix.Translation(score1Pos) * scalingM;
m_ScoreFont.FontResource.DrawText(m_ScoreSprite, m_Environment.Game.Player1Wins.ToString(),
		                  m_ScoreRect1, Direct3D.DrawTextFormat.NoClip, System.Drawing.Color.Yellow);
//Draw the second score
m_ScoreSprite.Transform = Matrix.Translation(score2Pos) * scalingM;
m_ScoreFont.FontResource.DrawText(m_ScoreSprite, m_Environment.Game.Player2Wins.ToString(),
		                  m_ScoreRect2, Direct3D.DrawTextFormat.NoClip, System.Drawing.Color.Yellow);
m_ScoreSprite.End();

Thanks again!

Share this post


Link to post
Share on other sites
Advertisement
Well, what is the problem you are encountering? I'm not 100% sure, but are sprites applicable with effects - I haven't tryed. If they aren't, you'll need to look into creating your own bitmap font system, with mesh creation.

Share this post


Link to post
Share on other sites
Sprites are applicable with effects, but the Font probably draws using a texture. Now I don't think I could use a pixel shader because the textures, or the letters that the font uses won't be available to me.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!