private void ExtraObjectCollection(MapObjectsDraw mapObjectsDraw, DrawPoints drawPoints) { for (int i = 0; i < 8; i += 2) { for (int x = drawPoints.overDrawPoints[i].X; x < drawPoints.overDrawPoints[i + 1].X; x++) { for (int y = drawPoints.overDrawPoints[i].Y; y < drawPoints.overDrawPoints[i + 1].Y; y++) { tileGrid[x, y].AddObjectToDraw(mapObjectsDraw); } } } }
public void DrawGroundLayers(SpriteBatch spriteBatch, DrawPoints drawPoints, MapObjectsDraw mapObjectsDraw) { EngineController.debugTilesOnScreen = 0; for (int x = drawPoints.topLeftPoint.X; x < drawPoints.botRightPoint.X; x++) { for (int y = drawPoints.topLeftPoint.Y; y < drawPoints.botRightPoint.Y; y++) { EngineController.debugTilesOnScreen++; tileGrid[x, y].Draw(spriteBatch); tileGrid[x, y].AddObjectToDraw(mapObjectsDraw); } } ExtraObjectCollection(mapObjectsDraw, drawPoints); }
public void AddObjectToDraw(MapObjectsDraw mapObjectsDraw) { if (fire != null && !fire.isCompleteBurntOut) { mapObjectsDraw.AddToFireList(fire); } if (mapObject != null) { mapObjectsDraw.AddToList(mapObject); } if (vehicle != null) { mapObjectsDraw.AddToVehicleLIst(vehicle); } if (burntLayer != null) { mapObjectsDraw.AddBurntTileToList(this); } }
public GameView(Rectangle location, DockType dockType) : base(location, dockType, true) { canChangeFocusOrder = false; world = WorldController.world; mapObjectsDraw = new MapObjectsDraw(); Vector2 cameraMin = new Vector2(GroundLayerController.tileSize, GroundLayerController.tileSize); Vector2 cameraMax = new Vector2((world.worldWidth * GroundLayerController.tileSize) - GroundLayerController.tileSize, (world.worldHeight * GroundLayerController.tileSize) - GroundLayerController.tileSize); camera = new Camera(containerCamera.worldCameraViewport, 4, cameraMin, cameraMax, false); camera.clampToMap = true; camera.CenterOn(new Vector2(24000, 24000)); camera.UpdateDrawPoints(GroundLayerController.tileSize, world.worldWidth, world.worldHeight); debugLabel = new Label("DEBUG", Font.Anita14, Color.White, new Vector2(300, 20), false, ""); camera.lockZoom = false; camera.lockKeyMove = false; backingWhite = GraphicsManager.GetSpriteColour(20); InitRendering(); //we can not set our container camera to be scrollable as that would simply bug our input and draw out }