title: How do I change the sprite in the timer when the object is created but is not visible camera?
body: <p>I want to change its sprite after a time if the object is not visible camera.
  I have a method that creates an object</p>
  
  <pre><code> private void spawnRaindrop() {
      Rectangle raindrop = new Rectangle();
      raindrop.x = MathUtils.random(0, Drop.WIDTH - 100);
      raindrop.y = Drop.WIDTH;
      raindrop.width = 100;
      raindrop.height = 100;
      raindrops.add(raindrop);
      lastDropTime = TimeUtils.nanoTime();
  }
  
  I have a method that changes the time interval through the sprites:
   public void timerSpriteChange() {
  
      Timer timer = new Timer();
      timer.schedule(new Timer.Task() {
                         @Override
                         public void run() {
  
  
                                 index = ((int) (Math.random() * MAX_SPRITES));
  
  
  
                         }
                     }
  
              , 0, 5);
  
  }
  </code></pre>
  
  <p>here I check and compare the time and call the method</p>
  
  <pre><code>  if (TimeUtils.nanoTime() - lastDropTime &gt; 1000000000) {
  
              spawnRaindrop();
  
          }
  </code></pre>
  
  <p>OrthographicCamera camera;</p>