private void BuildKeyList(Int32 columns)
{
if(columns < 1 || columns > TiledTexture.Texture.Width)
throw new ArgumentOutOfRangeException();
if(TiledTexture.Texture.Width % columns != 0)
throw new ArgumentOutOfRangeException();
Int32 tileWidth = TiledTexture.Texture.Width / columns;
Int32 tileHeight = TiledTexture.Texture.Height;
for(Int32 c = 0; c < columns; c++)
{
Int32 left = c * tileWidth;
Int32 top = 0;
Int32 right = left + tileWidth;
Int32 bottom = tileHeight;
Texture2dArea area = new Texture2dArea(left, top, right, bottom, TiledTexture.Texture.Width, TiledTexture.Texture.Height);
ColumnKey key = new ColumnKey(this, c, area);
Keys.Add(c, key);
}
}