List<RenderableComponent> renderableComponents = getAllRenderableComponents();
Collections.sort(renderableComponents, RenderableComparator.getInstance());
for(RenderableComponent renderableComp: renderableComponents){
PositionComponent posComp = (PositionComponent) renderableComp.getSiblingByType(PositionComponent.class.getName());
if(posComp != null){
Vector2f pos = posComp.getVector();
if(pos != null){
int x = Math.round(pos.getX());
int y = Math.round(pos.getY());
if(renderableComp.getOffsetFromOrigin() != null){
pos.add(renderableComp.getOffsetFromOrigin());
x = Math.round(pos.getX());
y = Math.round(pos.getY());
}
transformGraphicsFor(renderableComp, x, y, g);
CameraComponent camera = (CameraComponent) ComponentSystem.getInstance().getComponent(cameraPath);
if(camera != null){
Vector2f cameraPos = camera.getTopLeftPosition();
if(cameraPos != null){
x -= cameraPos.x;
y -= cameraPos.y;
}
if(camera.getWidth() != 0 && camera.getHeight() != 0){