Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpriteFont DrawString issue making text into black boxes #463

Open
Zoardedz opened this issue Jul 26, 2024 · 3 comments
Open

SpriteFont DrawString issue making text into black boxes #463

Zoardedz opened this issue Jul 26, 2024 · 3 comments
Labels

Comments

@Zoardedz
Copy link

I'm trying to make a GUI SpriteBatch that'll render a rectangle and an FPS counter as a test, I'm using your vs-templates (Win32 no device resources) with a few changes just making it more polymorphic, that aside there's a bug in my code that turns the text into black boxes if layered above the drawn rectangle, I assume this is because it's trying to reference the texture I used for the rectangle (images below)
image
image
I made a different SpriteBatch instance for the FPS counter but it also gave me the same result (surprisingly??)
I assume it could be as I said, trying to reference the image I used for the rectangle instead of the SpriteFont textures or an unrelated issue relating to blendstates or something else.

@Zoardedz
Copy link
Author

-I also used RenderDoc to check if the FPS text displays correctly when layered under the rectangle and it displayed the text like normal

@Zoardedz
Copy link
Author

If it helps, this is practically the draw function every IElement2D uses.
image

@walbourn
Copy link
Member

Is the render target here alpha-blended? Note that SpriteBatch defaults to using Premultiplied alpha, and if you are using straight-alpha with the rectangle it will be 'wrong' here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants