コード例 #1
0
 public void Add(UserInterlfaceContainer toAdd)
 {
     if (toAdd != null)
     {
         _userInterfaces.Add(toAdd);
     }
 }
コード例 #2
0
        public UserInterlfaceContainer CreateInfoPannel(Selector selector, Shape bounds)
        {
            UserInterlfaceContainer ui = new UserInterlfaceContainer(selector, true);

            GameObject pannel = CreatePanel(bounds);

            ui.Add(pannel);

            Point2D   startLocation = bounds.Copy().Add(Settings.PORTRAT_SPACING);
            Rectangle portratBounds = new Rectangle(startLocation, Settings.PORTRAT_SIZE, Settings.PORTRAT_SIZE);

            foreach (GameObject i in selector.GameObjects)
            {
                ui.Add(CreatePortart(selector, i, portratBounds.Copy()));

                portratBounds.Add(new Point2D(portratBounds.Size + Settings.PORTRAT_SPACING, 0));

                if (!CollsionDetector.Inside(portratBounds, bounds.HitBox))
                {
                    portratBounds.X  = startLocation.X;
                    portratBounds.Y += portratBounds.Height + Settings.PORTRAT_SPACING;
                }

                if (!CollsionDetector.Inside(portratBounds, bounds.HitBox))
                {
                    break;
                }
            }

            return(ui);
        }
コード例 #3
0
        public UserInterfaceManger(Factory factory, World world)
        {
            _factory = factory ?? throw new NullReferenceException();

            _selector = new Selector(world);
            _baseUI   = new UserInterlfaceContainer(_selector);

            AddStaticUI(world);
        }
コード例 #4
0
        private void LayersOfUIExample()
        {
            UserInterlfaceContainer layer1 = new UserInterlfaceContainer(_selector);

            layer1.Add(_factory.CreateInfoPannel(_selector, new Rectangle(0, 0, 100, 200)));
            UserInterlfaceContainer layer2 = new UserInterlfaceContainer(_selector);

            layer2.Add(_factory.CreateInfoPannel(_selector, new Rectangle(500, 0, 100, 200)));
            UserInterlfaceContainer layer3 = new UserInterlfaceContainer(_selector);

            layer3.Add(_factory.CreateInfoPannel(_selector, new Rectangle(700, 0, 100, 200)));

            layer2.Add(layer3);
            layer1.Add(layer2);
            Add(layer1);
        }
コード例 #5
0
 private void Add(UserInterlfaceContainer toAdd)
 {
     _baseUI.Add(toAdd);
 }