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 }; }