Skip to content
Richard Bates edited this page Jul 25, 2014 · 9 revisions

This needs to be added to your project for integrating box2dlights

In ApplicationListener#create:

rayHandler = new RayHandler(world);

This creates a new white point light.

new PointLight(rayHandler, RAYS_NUM, new Color(1,1,1,1), lightDistance, x, y);

In your render() loop after everything is drawn that you want to be lit:

rayHandler.setCombinedMatrix(camera.combined);
rayHandler.updateAndRender();

Remember to dispose():

rayHandler.dispose():

For more details, check out this example.

Clone this wiki locally