Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Draw text and color bar using sprites


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Yura   Members   -  Reputation: 263

Like
0Likes
Like

Posted 04 February 2013 - 06:55 AM

Hi,

I'm trying to draw text and color bar on my scene using sprites.

I want to achieve something like this: Capture2.PNG

 

I've tried to use this:

 

Font font = new Font(d3dDevice, new System.Drawing.Font("Arial", 20, 
System.Drawing.FontStyle.Regular));
            Sprite spr = new Sprite(d3dDevice);
            spr.Begin();
            font.DrawText(spr, "some string", 10, 20, new ColorBGRA(0, 65, 200, 0));
            spr.End();

 

but I've got just solid rectangles instead of each letter.

 

So, what should I do to receive desired result?



Sponsor:

#2 CrescentFresh   Members   -  Reputation: 141

Like
1Likes
Like

Posted 05 February 2013 - 10:17 AM

I'm not sure what you mean by "solid rectangles", but it may be that you don't have the correct render states enabled to draw text.

 

D3DXSPRITE_ALPHABLEND

D3DXSPRITE_SORT_TEXTURE

 

try enabling those states on the d3dDevice using SetRenderState();


Can I play with madness?


#3 Yura   Members   -  Reputation: 263

Like
0Likes
Like

Posted 06 February 2013 - 02:22 AM

I'm not sure what you mean by "solid rectangles", but it may be that you don't have the correct render states enabled to draw text.

 

D3DXSPRITE_ALPHABLEND

D3DXSPRITE_SORT_TEXTURE

 

try enabling those states on the d3dDevice using SetRenderState();

 

ALPHABLEND helped, thx

[RESOLVED]






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS