a.spritestudio.editor.xml.NodeReader.AtIntegers C# (CSharp) Method

AtIntegers() public method

intの配列で取得
public AtIntegers ( char separator ) : int[]
separator char
return int[]
        public int[] AtIntegers( char separator )
        {
            string v = node_.InnerText;
            string[] tokens = v.Split( separator );
            int[] results = new int[tokens.Length];

            for ( int i = 0; i < tokens.Length; ++i ) {
                int.TryParse( tokens[i], out results[i] );
            }
            return results;
        }

Same methods

NodeReader::AtIntegers ( string tag, char separator ) : int[]

Usage Example

コード例 #1
0
            public Cell( NodeReader node, int textureWidth, int textureHeight )
            {
                name = node.AtText( "name" );
                int[] pos = node.AtIntegers( "pos", ' ' );
                size = node.AtIntegers( "size", ' ' );
                pivot = node.AtFloats( "pivot", ' ' );
                rotated = node.AtBoolean( "rotated" );

                float s = pos[0] / (float) textureWidth;
                float t = 1f - (pos[1] / (float) textureHeight);
                float u = s + (size[0] / (float) textureWidth);
                float v = t - (size[1] / (float) textureHeight);
                uv = new float[4] { s, v, u, t };
            }