SFML community forums

Bindings - other languages => DotNet => Topic started by: Averon01 on April 07, 2012, 05:27:28 pm

Title: Text not rendering correctly
Post 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:
Code: [Select]
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
Title: Re: Text not rendering correctly
Post by: Laurent on April 07, 2012, 05:39:14 pm
Can you please show a complete and minimal code that reproduces the problem?
Title: Re: Text not rendering correctly
Post by: Averon01 on April 07, 2012, 05:56:39 pm
Here you go

Code: [Select]
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();
}
}
}
}
Title: Re: Text not rendering correctly
Post by: Laurent on April 07, 2012, 06:06:53 pm
It works for me.

Which revision of SFML 2 are you using?

Which OS? Which graphics card?
Title: Re: Text not rendering correctly
Post by: Averon01 on April 07, 2012, 06:09:28 pm
Just got it working myself, I hadn't used the newest csfml library which was provided. My bad.

Thanks for the fast response though!