TextureRegion and NinePatch rewritten.