How do i save the background from the screen. I draw a grid map, the cells are made up of actors, problem is i can pick up the individual cells with mouse, i want the cells to be permanently attached to the screen.
// In the world class, after actors are placed
actorsToBackground(Cell.class);
// repeat for different classes (in paint order)
//
// In the world class, add the following method
private void actorsToBackground(Class class)
{
for (Object obj : getObjects(class))
{
Actor actor = (Actor) obj;
int xLoc = actor.getX() - actor.getImage().getWidth() / 2;
int yLoc = actor.getY() - actor.getImage().getHeight() / 2;
getBackground().drawImage(actor.getImage(), xLoc, yLoc);
removeObject(actor)
}
}