Пример #1
0
 public void AddControl(AbstractControl ctrl)
 {
     controls.Add(ctrl);
     guiNode.AddChild(ctrl);
     ctrl.InputManager   = inputManager;
     ctrl.SpriteRenderer = spriteRenderer;
 }
Пример #2
0
 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));
         }
     }
 }
Пример #3
0
 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);
 }
Пример #4
0
 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;
 }
Пример #5
0
 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));
     }
 }
Пример #6
0
 public void RemoveControl(AbstractControl ctrl)
 {
     controls.Remove(ctrl);
     guiNode.RemoveChild(ctrl);
 }
Пример #7
0
 public void AddControl(AbstractControl ctrl)
 {
     controls.Add(ctrl);
     guiNode.AddChild(ctrl);
     ctrl.InputManager = inputManager;
     ctrl.SpriteRenderer = spriteRenderer;
 }
Пример #8
0
 public void RemoveControl(AbstractControl ctrl)
 {
     controls.Remove(ctrl);
     guiNode.RemoveChild(ctrl);
 }