1
Graphics / Rectangle Shape Bugg
« on: August 03, 2020, 08:37:30 pm »
Good evening lovely community,
im quite new working with SFML.NET using C#, and cannot come around a bug or a coding problem.
I simply try to draw a grid with 32x32 cells on the screen. With my code it works on "Monogame" but not with SFML 2.5. Strangely when i set the Outline Thickness less then .5 the vertical lines dissapear, above .5 it draws the horizontal lines double for some reason.
Here My code:
Outline Thickness .5
Outline Thickness .6
im quite new working with SFML.NET using C#, and cannot come around a bug or a coding problem.
I simply try to draw a grid with 32x32 cells on the screen. With my code it works on "Monogame" but not with SFML 2.5. Strangely when i set the Outline Thickness less then .5 the vertical lines dissapear, above .5 it draws the horizontal lines double for some reason.
Here My code:
Quote
RectangleShape rec = new RectangleShape();
{
for (int x = Globals.TileView.Left; x < GameData.Map[Form1.instance.listBox1.SelectedIndex].MaxX; x++)
{
for (int y = Globals.TileView.Top; y < GameData.Map[Form1.instance.listBox1.SelectedIndex].MaxY; y++)
{
rec.OutlineColor = new SFML.Graphics.Color(SFML.Graphics.Color.Red);
rec.OutlineThickness =(float) 0.6f;
rec.FillColor = new SFML.Graphics.Color(SFML.Graphics.Color.Transparent);
rec.Size = new Vector2f(System.Convert.ToSingle(System.Convert.ToSingle(x * GameInfo.PIC_X)), System.Convert.ToSingle(y * GameInfo.PIC_X));
rec.Position = new Vector2f(Graphics.ConvertMapX((x - 1) * GameInfo.PIC_X), Graphics.ConvertMapY((y - 1) * GameInfo.PIC_Y));
Graphics.GameWindow.Draw(rec);
}
}
}
Outline Thickness .5
Outline Thickness .6