Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Kaymak

Pages: [1]
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:
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

Pages: [1]