package com.mygdx.game;
import java.awt.Rectangle;
import java.nio.IntBuffer;
import box2dLight.PointLight;
import box2dLight.RayHandler;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GL30;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.CircleShape;
import com.badlogic.gdx.physics.box2d.Fixture;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.badlogic.gdx.utils.BufferUtils;
public class MyGdxGame extends ApplicationAdapter {
SpriteBatch batch;
RayHandler rayhandler;
World world;
OrthographicCamera camera;
private PointLight light;
private static Texture texture;
@Override
public void create () {
texture = new Texture(Gdx.files.internal("backround.png"));
batch = new SpriteBatch();
camera = new OrthographicCamera(1280, 720);
world = new World(new Vector2(0, 1), true);
rayhandler = new RayHandler(world);
light = new PointLight(rayhandler, 1000, new Color(0,140,150,255), 32*30, 0, 20);
}
@Override
public void render () {
Gdx.gl20.glClearColor(1, 0, 0, 0);
Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.setTransformMatrix(camera.combined);
batch.begin();
batch.draw(texture, 0, 0);
rayhandler.setCombinedMatrix(camera);
rayhandler.updateAndRender();
batch.end();
}
@Override
public void dispose() {
texture.dispose();
batch.dispose();
world.dispose();
rayhandler.dispose();
}
}
i have looked on google and can not find anything but the f**king image just keeps on being white it works perfect if i start new project and use there image but why does not this one work?