Myre.UI.Text.StringPart.Substring C# (CSharp) Méthode

Substring() public méthode

public Substring ( int start ) : StringPart
start int
Résultat StringPart
        public StringPart Substring(int start)
        {
            return Substring(start, Length - start);
        }

Same methods

StringPart::Substring ( int start, int length ) : StringPart

Usage Example

Exemple #1
0
        private static TagType ParseTag(StringPart text, ref Vector2 position, ref int lineSpacing, ref int lineIndex)
        {
            var type = TagType.None;

            if (text.Equals("\n"))
            {
                NewLine(ref position, ref lineSpacing, ref lineIndex);
                type = TagType.NewLine;
            }
            else if (text.StartsWith("f:") && fonts != null)
            {
                var        fontName = text.Substring(2);
                SpriteFont font;
                if (fonts.TryParse(fontName, out font))
                {
                    PushFont(font);
                    type = TagType.FontStart;
                }
            }
            else if (text.Equals("/f"))
            {
                PopFont();
                type = TagType.FontEnd;
            }
            else if (text.StartsWith("c:"))
            {
                var   colourName = text.Substring(2);
                Color colour;
                if (ColourParser.TryParse(colourName, out colour))
                {
                    PushColour(colour);
                    type = TagType.ColourStart;
                }
            }
            else if (text.Equals("/c"))
            {
                PopColour();
                type = TagType.ColourEnd;
            }

            return(type);
        }
All Usage Examples Of Myre.UI.Text.StringPart::Substring