Garmaine Staff asked 2 years ago

Is it possible to run a thread just after render method only once since render loop will call it in every iteration. This is my thread:

    new Thread(new Runnable() {
        float time=0;
        @Override
        public void run() {
            while(redPos<10) {
                time += Gdx.graphics.getDeltaTime();
                redPos+=(int)time;
            }
        }
    }).start();

I am not very much acquainted with threads so dont know proper way of doing it. Please correct me if i am going wrong