SFML community forums
Bindings - other languages => DotNet => Topic started by: Averon01 on April 07, 2012, 05:27:28 pm
-
Hello
I've encountered a problem when displaying text. When ever I draw text I get these blocks that look to be able the size of the character that should be present there. These blocks are the same colour as I've set the text. Any help would be great. Oh i'm using the latest revision of SFML.Net from GitHub.
This is my code:
text = new Text();
text.DisplayedString = "This produces blocks which look to be the same size of the letter";
text.Color = Color.Red;
text.Position = new Vector2f(0,0);
Graphics.Draw(text);
Cheers
-
Can you please show a complete and minimal code that reproduces the problem?
-
Here you go
using SFML.Graphics;
using SFML.Window;
namespace TextProblem
{
public class EntryPoint
{
public static void Main()
{
Program prog = new Program();
}
}
public class Program
{
RenderWindow Graphics;
bool running;
Text text;
public Program()
{
Graphics = new RenderWindow(new VideoMode(800,600),"Text problem");
text = new Text();
text.DisplayedString = "Text";
text.Position = new Vector2f(0,0);
text.CharacterSize = 30;
Loop();
}
public void Loop()
{
running = true;
while(running)
{
Graphics.DispatchEvents();
Graphics.Clear();
Graphics.Draw(text);
Graphics.Display();
}
}
}
}
-
It works for me.
Which revision of SFML 2 are you using?
Which OS? Which graphics card?
-
Just got it working myself, I hadn't used the newest csfml library which was provided. My bad.
Thanks for the fast response though!