Jlayer modified version for use by libgdx