Search in sources :

Example 1 with PointLight

use of box2dLight.PointLight in project Eidolons by IDemiurge.

the class TrueLight method bindEvents.

public void bindEvents() {
    GuiEventManager.bind(GuiEventType.ADD_LIGHT, p -> {
        Vector2 v = (Vector2) p.get();
        new ConeLight(rayHandler, 3, GdxColorMaster.ENEMY_COLOR, 200, v.x, v.y, 200, 100);
        new PointLight(rayHandler, 3, GdxColorMaster.ENEMY_COLOR, 200, v.x, v.y);
    });
}
Also used : ConeLight(box2dLight.ConeLight) Vector2(com.badlogic.gdx.math.Vector2) PointLight(box2dLight.PointLight)

Example 2 with PointLight

use of box2dLight.PointLight in project Eidolons by IDemiurge.

the class LightMap method init.

// 
private void init(DequeImpl<BattleFieldObject> units, World world, RayHandler rayHandler, float cellWidth, float cellHeight, int rows, int cols) {
    testA = 1600;
    testB = 900;
    this.units = units;
    this.cellWidth = cellWidth;
    this.cellHeight = cellHeight;
    if (rows > 0) {
        this.rows = rows - 1;
    } else {
        this.rows = 0;
    }
    if (cols > 0) {
        this.cols = cols - 1;
    } else {
        this.cols = 0;
    }
    LightMap.world = world;
    LightMap.rayHandler = rayHandler;
    LightMap.rayHandler.setBlur(true);
    LightMap.rayHandler.setBlurNum(15);
    ambientColor = new Color(0.2f, 0.1f, 0.3f, ambientAlpha);
    LightMap.rayHandler.setAmbientLight(ambientColor);
    LightMap.rayHandler.setAmbientLight(LightingManager.ambient_light);
    RayHandler.setGammaCorrection(true);
    debugRenderer = new Box2DDebugRenderer();
    mouseLight = new PointLight(rayHandler, 100, Color.RED, LightingManager.mouse_light_distance, 0, 0);
    LightingManager.setMouse_light(true);
    new ConeLight(rayHandler, 3, GdxColorMaster.ENEMY_COLOR, 200, 350, 350, 200, 100);
    updateMap();
// bindEvents();
}
Also used : ConeLight(box2dLight.ConeLight) Color(com.badlogic.gdx.graphics.Color) PointLight(box2dLight.PointLight)

Aggregations

ConeLight (box2dLight.ConeLight)2 PointLight (box2dLight.PointLight)2 Color (com.badlogic.gdx.graphics.Color)1 Vector2 (com.badlogic.gdx.math.Vector2)1