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

These need to be added to your project for integrating the box2dligths

In ApplicationListener#create:

rayHandler = new RayHandler(world);

This create new white point light.

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

In gameloop after everything is drawed that you want to be lit:

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

Rembember call on dispose:

rayHandler.dispose():

For more details, check out this example.

Clone this wiki locally