Exemplo n.º 1
0
        public CategoryCustomNode()
        {
            // level 0
            // init text elements
            // name
            _name       = new TextElement();
            _name.Style = new Style();
            // description
            _description       = new TextElement();
            _description.Style = new Style();
            _description.Width = 120;
            // init image element
            _img       = new ImageElement();
            _img.Style = new Style();
            _img.Size  = new Size(70, 50);
            // init a grid for text elements
            var cp = new ColumnPanel();

            cp.Children.Add(_name);
            cp.Children.Add(_description);
            // init panel for image
            _rw = new RowPanel();
            _rw.Children.Add(cp);
            _rw.Children.Add(_img);
            _rw.Style = new Style();
            _rw.Style.VerticalAlignment = Alignment.Center;
            // level 1
            _product       = new TextElement();
            _product.Style = new Style();
        }
Exemplo n.º 2
0
        public HyperLinkPresenter()
        {
            _hyperLink               = new HyperLinkElement();
            _hyperLink.Style         = new Style();
            _hyperLink.Style.Margins = new Thickness(0, 4);
            _hyperLink.Click        += hyperLink_Click;
            // CustomContentPresenter child has a parent size, so we add an intermediate panel.
            var panel = new RowPanel();

            panel.Children.Add(_hyperLink);

            Child = panel;
        }
Exemplo n.º 3
0
        private void initStuff()
        {
            //load data from files
            TextureManager.initAll();
            CharacterInfo.allInfos = FileLineLoader.LoadCharInfos();
            Equip.allWeapons       = FileLineLoader.LoadWeapons();
            Equip.allArmors        = FileLineLoader.LoadArmors();
            Magic.Init();

            //character selection
            control.bind(charSel);
            charSel.control = control;
            charSel.bindHadlers();

            //shop
            Shop.shop.selection = charSel;
            control.bind(Shop.shop);

            //equip selection
            control.bind(equipSel);
            equipSel.control = control;
            equipSel.init();

            //bind character and equip
            charSel.characterChangedEvent += new CharacterSelection.CharacterChanged(equipSel.setCharacter);

            //play button
            control.getPlayButton().Click += new EventHandler(playPressed);

            //monster infos
            MonsterInfo.allMonsterInfos = FileLineLoader.LoadMonstersInfos();

            //drawing panels
            DisplayPanel.Init();
            RowPanel.Init();
        }