Text has black outline in render texture
When rendering text to a render texture it has a strange black outline around it.
- Text 1 was rendered to the render texture and draw_texture_ex() to the screen
- Text 2 was draw_text_ex() directly
- I call
self.target_1.clone().unwrap().texture.set_filter(FilterMode::Nearest);right after making the target_1
Creating the RenderTexture:
self.target_1 = Some(render_target(400.0, 400.0));
Drawing the texture
draw_texture_ex(
&target_1.texture,
rect.x + 5.0,
rect.y + 5.0 + title_thickness,
WHITE,
DrawTextureParams {
source: Some(Rect::new(
0.0,
0.0,
(400.0 - 5.0),
(400.0 - 35.0)
)),
..Default::default()
},
);
@not-fl3
Also do you have any idea why all my text becomes black sometimes? I think its part of this issue as well since it just becomes overly bold.
Also do you have any idea why all my text becomes black sometimes?
I also encounter the black text issue at seemingly random intervals. This is using draw_text_ex.
Reloading the font file via load_ttf_font seems to resolve the issue, so I wonder if it's not in fact an issue in drawing the font but rather loading it?
Yeah I believe so. Another thing that happens is sometimes the entire text is a black block.
Changing the text and restarting seems to fix it, but it becomes bugged again randomly.
@creepersaur and @tom-sson I opened a separate issue for that weird black text issue - it's affecting me too but it seems like a separate thing: https://github.com/not-fl3/macroquad/issues/1006