public void AddControl(AbstractControl ctrl) { controls.Add(ctrl); guiNode.AddChild(ctrl); ctrl.InputManager = inputManager; ctrl.SpriteRenderer = spriteRenderer; }
private void RenderControl(AbstractControl ctrl) { ctrl.Render(); for (int i = 0; i < ctrl.Children.Count; i++) { if (ctrl.GetChild(i) is AbstractControl) { RenderControl((AbstractControl)ctrl.GetChild(i)); } } }
public static bool Collides(AbstractControl control, int x, int y) { if (x > control.GetWorldTranslation().x&& x < control.GetWorldTranslation().x + control.Width) { if (y > control.GetWorldTranslation().y&& y < control.GetWorldTranslation().y + control.Height) { return(true); } } return(false); }
public static bool Collides(AbstractControl control, int x, int y) { if (x > control.GetWorldTranslation().x && x < control.GetWorldTranslation().x + control.Width) { if (y > control.GetWorldTranslation().y && y < control.GetWorldTranslation().y + control.Height) { return true; } } return false; }
private void RenderControl(AbstractControl ctrl) { ctrl.Render(); for (int i = 0; i < ctrl.Children.Count; i++) { if (ctrl.GetChild(i) is AbstractControl) RenderControl((AbstractControl)ctrl.GetChild(i)); } }
public void RemoveControl(AbstractControl ctrl) { controls.Remove(ctrl); guiNode.RemoveChild(ctrl); }