public HexTile(HexGrid _grid, int _i, int _j, float _radius, Color4 _color) { grid = _grid; i = _i; j = _j; Radius = _radius; Altitude = GetAltitude(); X = GetX(); Y = GetY(); var rotationRad = grid.Horizontal ? (float)(0.5f * Math.PI) : 0; polygonRenderer = new PolygonFillRenderer(ConvexPolygon.Regular(6, Radius, rotationRad), X, Y, Color4.Red); polygonRenderer.MoveRelative(new Vector3(X, Y, 0)); }
public PolygonActor(Polygon _polygon, float _x = 0, float _y = 0, bool _center = true, bool _filled = true, bool _outlined = true) : base(_x, _y) { Polygon = _polygon; if (_center) { center(); } if (_filled) { FillRenderer = new PolygonFillRenderer(Polygon, X, Y, ColorExtensions.RandomColor()); } if (_outlined) { OutlineRenderer = new PolygonOutlineRenderer(Polygon, X, Y, ColorExtensions.RandomColor()); } }