Some customized libgdx code.