public override void Render(Batcher batcher, Camera camera) { batcher.DrawPixel(_lastPosition.X, _lastPosition.Y, Color.Yellow, 4); batcher.DrawPixel(Transform.Position.X, Transform.Position.Y, Color.White, 4); batcher.DrawLine(_lastPosition, Transform.Position, Color.White); if (_collisionPosition.X > 0 && _collisionPosition.Y > 0) { batcher.DrawPixel(_collisionPosition.X, _collisionPosition.Y, Color.Red, 10); } }
public void DebugRender(Batcher batcher) { if (DrawConstraints) { for (var i = 0; i < _constraints.Length; i++) { _constraints.Buffer[i].DebugRender(batcher); } } if (DrawParticles) { for (var i = 0; i < Particles.Length; i++) { if (Particles.Buffer[i].Radius == 0) { batcher.DrawPixel(Particles.Buffer[i].Position, ECDebug.Colors.VerletParticle, 4); } else { batcher.DrawCircle(Particles.Buffer[i].Position, (int)Particles.Buffer[i].Radius, ECDebug.Colors.VerletParticle, 1, 4); } } } }
public override void Render(Batcher batcher, Camera camera) { // if we have a path render all the nodes if (_breadthSearchPath != null) { foreach (var node in _breadthSearchPath) { var x = node.X * _tilemap.TileWidth + _tilemap.TileWidth * 0.5f; var y = node.Y * _tilemap.TileHeight + _tilemap.TileHeight * 0.5f; batcher.DrawPixel(x + 2, y + 2, Color.Yellow, 4); } } if (_weightedSearchPath != null) { foreach (var node in _weightedSearchPath) { var x = node.X * _tilemap.TileWidth + _tilemap.TileWidth * 0.5f; var y = node.Y * _tilemap.TileHeight + _tilemap.TileHeight * 0.5f; batcher.DrawPixel(x - 2, y - 2, Color.Blue, 4); } } if (_astarSearchPath != null) { foreach (var node in _astarSearchPath) { var x = node.X * _tilemap.TileWidth + _tilemap.TileWidth * 0.5f; var y = node.Y * _tilemap.TileHeight + _tilemap.TileHeight * 0.5f; batcher.DrawPixel(x, y, Color.Orange, 4); } } }
void RenderPaths(Batcher batcher, SvgPath[] paths) { if (paths == null && _pathBuilder != null) { return; } foreach (var path in paths) { var points = path.GetTransformedDrawingPoints(_pathBuilder, 3); for (var i = 0; i < points.Length - 1; i++) { batcher.DrawLine(points[i], points[i + 1], path.StrokeColor, path.StrokeWidth); batcher.DrawPixel(points[i], Color.Yellow, 3); } } }