私はプロジェクトに Libgdx を使用しており、より正確には Box2DLights を使用しています。
私の問題は次のとおりです。新しい「PointLight」を配置したい場合、常に画面の中央にあります。座標を変更すると、機能しません。
私の "show()" メソッド内:
Box2D.init();
world = new World(new Vector2(0, 0), true);
rh = new RayHandler(world);
rh.setAmbientLight(1.2f, 0.2f, 0.2f, 0.1f);
pl = new PointLight(rh, 100, new Color(1,1,1,1),(float) 0.5,0,0);
私の "render()" メソッド内:
Gdx.gl.glClearColor(0f, 0f, 0f, 1f);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
world.step(delta, 8, 3);
renderer.begin(ShapeType.Filled);
for (SolarSystem ss : solarSystemList)
{
if(ss.getColor() <= 15) colorSS = Color.YELLOW;
else if(ss.getColor() > 15 && ss.getColor() < 31) colorSS = Color.ORANGE;
else if(ss.getColor() > 30 && ss.getColor() < 46) colorSS = Color.RED;
else if(ss.getColor() > 45) colorSS = Color.CYAN;
renderer.setColor(colorSS);
renderer.circle(ss.getMapX(), ss.getMapY(), ss.getSize() - 3);
}
renderer.end();
rh.updateAndRender();
結果 :
pl = new PointLight(rh, 100, new Color(1,1,1,1),(float) 0.5, 50, 50);
...もう光がありません
どうすれば好きな場所に光を当てることができるか知っていますか?
編集: 私の画面サイズ: 幅 - 860px / 高さ - 645px