A 2D shape to be rendered defined by its border points, will be rendered with a filled color.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Entities Entity
DeltaEngine.Entities DrawableEntity
DeltaEngine.Rendering2D Entity2D
DeltaEngine.Rendering2D.Shapes Polygon2D
DeltaEngine.Rendering2D.Shapes Ellipse
DeltaEngine.Rendering2D.Shapes FilledRect
Namespace: DeltaEngine.Rendering2D.Shapes
Assembly: DeltaEngine.Rendering2D.Shapes (in DeltaEngine.Rendering2D.Shapes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Polygon2D type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Polygon2D | Initializes a new instance of the Polygon2D class |
Methods
Extension Methods
Name | Description | |
---|---|---|
AffixToPhysics | (Defined by Entity2DPhysicsExtensions.) | |
StartBouncingOffScreenEdges | (Defined by Entity2DExtensions.) | |
StartFalling | (Defined by Entity2DExtensions.) | |
StartMoving | (Defined by Entity2DExtensions.) | |
StartRotating | (Defined by Entity2DExtensions.) |
Fields
Name | Description | |
---|---|---|
components | (Inherited from Entity.) | |
lastTickLerpComponents |
Each element can either be a Lerp, a Lerp List or an array of Lerp objects.
View code on GitHub (Inherited from DrawableEntity.) |
Properties
Name | Description | |
---|---|---|
Alpha | (Inherited from Entity2D.) | |
Center | (Inherited from Entity2D.) | |
Color | (Inherited from Entity2D.) | |
DidFootprintChange | (Inherited from Entity2D.) | |
DrawArea | (Overrides Entity2D DrawArea.) | |
IsActive | (Inherited from DrawableEntity.) | |
IsPauseable | (Inherited from Entity.) | |
IsVisible | (Inherited from DrawableEntity.) | |
LastColor | (Inherited from Entity2D.) | |
LastDrawArea | (Inherited from Entity2D.) | |
NumberOfComponents | (Inherited from Entity.) | |
Points | ||
RenderLayer | (Inherited from DrawableEntity.) | |
Rotation | (Inherited from Entity2D.) | |
RotationCenter | (Inherited from Entity2D.) | |
Size | (Inherited from Entity2D.) | |
TopLeft | (Inherited from Entity2D.) | |
UpdatePriority | (Inherited from Entity.) |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void NewPolygon() { var polygon = new Polygon2D(Rectangle.One, Color.White); polygon.Points.AddRange(new[] { Vector2D.Zero, Vector2D.One, Vector2D.UnitY });
[Test, CloseAfterFirstFrame] public void ChangePolygonAfterFirstFrame() { var polygon = new Polygon2D(Rectangle.One, Color.White); polygon.Points.AddRange(new[] { Vector2D.Zero, Vector2D.One, Vector2D.UnitY });
[Test, CloseAfterFirstFrame] public void ChangeOutlineColor() { var polygon = new Polygon2D(Rectangle.One, Color.Red); polygon.Add(new OutlineColor(Color.Blue)); Assert.AreEqual(Color.Blue, polygon.Get<OutlineColor>().Value); }
See Also