This piece of code is returning on a infinite base how to fix?
public GuiElement MoveElement(int x, int y)
{
GUIRect = new Rectangle(GUIRect.X += x,GUIRect.Y += y,GUIRect.Width,GUIRect.Height);
return MoveElement(x,y);
}
this is where i set the values i have in my Other class
gm.Add(new GuiElement("BackGround"));
gm.Add(new GuiElement("Play_Button").MoveElement(150, 50));
gm.Add(new GuiElement("HighScore_Button"));
gm.Add(new GuiElement("Quit_Button"));
basicly i want a to be able to move some elements using that MoveElement
it creates a infinite loop
An unhandled exception of type 'System.StackOverflowException' occurred in giftman.exe
return this;
\$\endgroup\$