move the code into spritesheetmanager