Пример #1
0
 internal Column(TabListInFrame tabList)
 {
     this.tabList = tabList;
     this.Text = new FreeText(tabList.ColumnTextBuilder);
     this.Text.TextColor = tabList.ColumnTextColor;
     this.Text.Align = tabList.ColumnTextAlign;
     this.Text.Position = new Rectangle(0, 0, 0, tabList.columnheaderHeight);
 }
Пример #2
0
 internal Tab(TabListInFrame tabList, ListKind listKind)
 {
     this.Text = new FreeText(tabList.TabTextBuilder);
     this.Text.TextColor = tabList.TabTextColor;
     this.Text.Align = tabList.TabTextAlign;
     this.tabList = tabList;
     this.listKind = listKind;
     this.Columns = new List<Column>();
 }
Пример #3
0
        public void Initialize(MainMapLayer mainMapLayer, MainGameScreen screen)
        {
            this.mainMapLayer = mainMapLayer;
            this.screen = screen;
            //this.Conment = new FreeText(screen.GraphicsDevice, new System.Drawing.Font("宋体", 10f), Color.White);
            this.Conment = new FreeText(screen.GraphicsDevice,new System.Drawing.Font("宋体", 10f), Color.White);
            this.Conment.Align = TextAlign.Middle;

            this.currentPositionTexture = screen.Textures.TileFrameTextures[0];
            this.EffectingAreaTexture = screen.Textures.TileFrameTextures[4];
        }
Пример #4
0
        private void chushihuajianzhubiaotiheqizi()
        {
            System.Drawing.Font fontjianzhu = new System.Drawing.Font("华文中宋", 16f);
            Microsoft.Xna.Framework.Graphics.Color colorjianzhu = new Color();
            colorjianzhu.PackedValue = uint.Parse("4278255615");

            //System.Drawing.Font font1 = new System.Drawing.Font("方正北魏楷书繁体", 30f);   //方正北魏楷书繁体
            //Microsoft.Xna.Framework.Graphics.Color color1 = new Color(1f, 1f, 1f);

            qizidezi = new FreeText(base.spriteBatch.GraphicsDevice, new System.Drawing.Font("方正北魏楷书繁体", 30f), new Color(1f, 1f, 1f));


            foreach (Architecture jianzhu in base.Scenario.Architectures)
            {

                //jianzhu.jianzhubiaoti = new FreeText(spriteBatch.GraphicsDevice, fontjianzhu, colorjianzhu);
                ///////jianzhu.jianzhubiaoti.DisplayOffset = new Point(0, -mainMapLayer.TileWidth / 2);
                //jianzhu.jianzhubiaoti.Text = jianzhu.Name;
                //jianzhu.jianzhubiaoti.Align = TextAlign.Left;
                jianzhu.jianzhuqizi = new qizi();
                //jianzhu.jianzhuqizi.qizidezi = new FreeText(spriteBatch.GraphicsDevice, font1, color1);
                try
                {
                    jianzhu.CaptionTexture = Texture2D.FromFile(base.spriteBatch.GraphicsDevice, "Resources/Architecture/Caption/" +jianzhu.CaptionID + ".png");
                }
                catch
                {
                    jianzhu.CaptionTexture = Texture2D.FromFile(base.spriteBatch.GraphicsDevice, "Resources/Architecture/Caption/None.png");
                }
                /*
                if (jianzhu.BelongedFaction != null)
                {
                    jianzhu.jianzhuqizi.qizidezi.Text = jianzhu.BelongedFaction.ToString().Substring(0, 1);
                }*/

                this.qizidezi.Align = TextAlign.Middle;


                jianzhu.jianzhuqizi.qizipoint = new Point(jianzhu.dingdian.X, jianzhu.dingdian.Y-1);

            }
        }
Пример #5
0
 internal void SetStyle(string style)
 {
     OptionStyle style2 = null;
     this.Styles.TryGetValue(style, out style2);
     if (style2 != null)
     {
         this.TitleTexture = style2.TitleTexture;
         this.TitleWidth = style2.TitleWidth;
         this.TitleHeight = style2.TitleHeight;
         this.TitleMargin = style2.TitleMargin;
         this.TitleText = style2.TitleText;
         this.OptionTextList = style2.OptionTextList;
         this.ItemHeight = style2.ItemHeight;
         this.Margin = style2.Margin;
         this.OptionTexture = style2.OptionTexture;
         this.OptionSelectedTexture = style2.OptionSelectedTexture;
     }
 }
Пример #6
0
 public void ResetAllTextures()
 {
     int num;
     if (this.Editable)
     {
         for (num = 0; num < this.tabList.gameObjectList.Count; num++)
         {
             if ((bool) StaticMethods.GetPropertyValue(this.tabList.gameObjectList[num], this.Name))
             {
                 this.ColumnTextList[num].TextTexture = this.tabList.MultiSelecting ? this.tabList.checkboxSelectedTexture : this.tabList.roundcheckboxSelectedTexture;
             }
             else
             {
                 this.ColumnTextList[num].TextTexture = this.tabList.MultiSelecting ? this.tabList.checkboxTexture : this.tabList.roundcheckboxTexture;
             }
         }
         this.ColumnTextList.ResetAllAlignedPositions();
     }
     else
     {
         for (num = 0; num < this.tabList.gameObjectList.Count && num < this.ColumnTextList.Count; num++)
         {
             this.ColumnTextList[num].Text = StaticMethods.GetPropertyValue(this.tabList.gameObjectList[num], this.Name).ToString();
         }
         this.ColumnTextList.ResetAllTextTextures();
         this.ColumnTextList.ResetAllAlignedPositions();
     }
 }
 public void LoadDataFromXMLDocument(string filename)
 {
     Font font;
     Microsoft.Xna.Framework.Graphics.Color color;
     XmlDocument document = new XmlDocument();
     document.Load(filename);
     XmlNode nextSibling = document.FirstChild.NextSibling;
     XmlNode node = nextSibling.ChildNodes.Item(0);
     this.routewayEditor.BackgroundTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.BackgroundSize = new Microsoft.Xna.Framework.Point(int.Parse(node.Attributes.GetNamedItem("Width").Value), int.Parse(node.Attributes.GetNamedItem("Height").Value));
     node = nextSibling.ChildNodes.Item(1);
     this.routewayEditor.CommentBackgroundTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.CommentClientWidth = int.Parse(node.Attributes.GetNamedItem("Width").Value);
     node = nextSibling.ChildNodes.Item(2);
     this.routewayEditor.Comment.ClientWidth = this.routewayEditor.CommentClientWidth;
     this.routewayEditor.Comment.RowMargin = int.Parse(node.Attributes.GetNamedItem("RowMargin").Value);
     StaticMethods.LoadFontAndColorFromXMLNode(node, out font, out color);
     this.routewayEditor.Comment.Builder.SetFreeTextBuilder(this.graphicsDevice, font);
     this.routewayEditor.Comment.DefaultColor = color;
     node = nextSibling.ChildNodes.Item(3);
     StaticMethods.LoadFontAndColorFromXMLNode(node, out font, out color);
     this.routewayEditor.TitleText = new FreeText(this.graphicsDevice, font, color);
     this.routewayEditor.TitleText.Position = StaticMethods.LoadRectangleFromXMLNode(node);
     this.routewayEditor.TitleText.Align = (TextAlign) Enum.Parse(typeof(TextAlign), node.Attributes.GetNamedItem("Align").Value);
     this.routewayEditor.TitleText.Text = node.Attributes["Text"].Value;
     node = nextSibling.ChildNodes.Item(4);
     this.routewayEditor.ExtendButtonPosition = StaticMethods.LoadRectangleFromXMLNode(node);
     this.routewayEditor.ExtendButtonTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.ExtendButtonSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value);
     this.routewayEditor.ExtendButtonDownTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Down").Value);
     this.routewayEditor.ExtendButtonDisabledTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value);
     node = nextSibling.ChildNodes.Item(5);
     this.routewayEditor.CutButtonPosition = StaticMethods.LoadRectangleFromXMLNode(node);
     this.routewayEditor.CutButtonTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.CutButtonSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value);
     this.routewayEditor.CutButtonDownTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Down").Value);
     this.routewayEditor.CutButtonDisabledTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value);
     node = nextSibling.ChildNodes.Item(6);
     this.routewayEditor.DirectionSwitchPosition = StaticMethods.LoadRectangleFromXMLNode(node);
     this.routewayEditor.DirectionSwitchTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.DirectionSwitchSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value);
     this.routewayEditor.DirectionSwitchDisabledTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value);
     node = nextSibling.ChildNodes.Item(7);
     this.routewayEditor.BuildButtonPosition = StaticMethods.LoadRectangleFromXMLNode(node);
     this.routewayEditor.BuildButtonTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.BuildButtonSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value);
     this.routewayEditor.BuildButtonDownTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Down").Value);
     node = nextSibling.ChildNodes.Item(8);
     this.routewayEditor.EndButtonPosition = StaticMethods.LoadRectangleFromXMLNode(node);
     this.routewayEditor.EndButtonTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.EndButtonSelectedTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Selected").Value);
     this.routewayEditor.EndButtonDownTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Down").Value);
     node = nextSibling.ChildNodes.Item(9);
     this.routewayEditor.ExtendMouseArrowSize = new Microsoft.Xna.Framework.Point(int.Parse(node.Attributes.GetNamedItem("Width").Value), int.Parse(node.Attributes.GetNamedItem("Height").Value));
     this.routewayEditor.ExtendMouseArrowTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.ExtendDisabledMouseArrowTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value);
     node = nextSibling.ChildNodes.Item(10);
     this.routewayEditor.CutMouseArrowSize = new Microsoft.Xna.Framework.Point(int.Parse(node.Attributes.GetNamedItem("Width").Value), int.Parse(node.Attributes.GetNamedItem("Height").Value));
     this.routewayEditor.CutMouseArrowTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.CutDisabledMouseArrowTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("Disabled").Value);
     node = nextSibling.ChildNodes.Item(11);
     this.routewayEditor.ExtendPointTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("FileName").Value);
     this.routewayEditor.ExtendPointEndTexture = Texture2D.FromFile(this.graphicsDevice, @"GameComponents\RoutewayEditor\Data\" + node.Attributes.GetNamedItem("End").Value);
     StaticMethods.LoadFontAndColorFromXMLNode(node, out font, out color);
     TextAlign align = (TextAlign) Enum.Parse(typeof(TextAlign), node.Attributes.GetNamedItem("Align").Value);
     for (int i = 0; i < 4; i++)
     {
         FreeText item = new FreeText(this.graphicsDevice, font, color) {
             Align = align
         };
         this.routewayEditor.ExtendPointTexts.Add(item);
     }
 }