Back to project page acceptableLosses.
The source code is released under:
MIT License
If you think the Android project acceptableLosses listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package acceptableLosses.systems; /*from ww w. ja va 2 s .c o m*/ import acceptableLosses.map.Furniture; import acceptableLosses.map.Region; import acceptableLosses.screens.GameScreen; import com.artemis.systems.VoidEntitySystem; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class FurnitureRenderSystem extends VoidEntitySystem { private SpriteBatch spriteBatch; private Region region; private GameScreen gameScreen; public FurnitureRenderSystem(GameScreen gameScreen, SpriteBatch spriteBatch, Region region) { this.gameScreen = gameScreen; this.spriteBatch = spriteBatch; this.region = region; } @Override protected void processSystem() { spriteBatch.setColor(Color.WHITE); // if we can limit this to what the camera sees, we can speed it up slightly for (int x = 0; x < region.xSize; x++) { for (int y = 0; y < region.ySize; y++) { Furniture furniture = region.furniture[x][y][gameScreen.zLevel]; if (furniture != null && furniture.furnitureType != null && furniture.furnitureType.texture != null) { spriteBatch.draw(furniture.furnitureType.texture, x, y, 1, 1); } } } } }