Basis of all 2D entity objects to render like lines, sprites etc.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Entities Entity
DeltaEngine.Entities DrawableEntity
DeltaEngine.Rendering2D Entity2D
Asteroids Projectile
CarGame2D Track
DeltaEngine.Rendering2D.Fonts FontText
DeltaEngine.Rendering2D.Fonts VectorText
DeltaEngine.Rendering2D.Graphs GradientGraph
DeltaEngine.Rendering2D HierarchyEntity2D
DeltaEngine.Rendering2D.Shapes GradientFilledRect
DeltaEngine.Rendering2D.Shapes Grid2D
DeltaEngine.Rendering2D.Shapes Line2D
DeltaEngine.Rendering2D.Shapes Polygon2D
DeltaEngine.Rendering2D.Spine SpineSkeleton
GameOfLife GameManager
GameOfLife GameOfLife
SideScroller Game
Snake Snake
Namespace: DeltaEngine.Rendering2D
Assembly: DeltaEngine.Rendering2D (in DeltaEngine.Rendering2D.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Entity2D type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Entity2D | Initializes a new instance of the Entity2D class | |
Entity2D(Rectangle) | Initializes a new instance of the Entity2D 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.) | |
DefaultColor | ||
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 | ||
Center | ||
Color | ||
DidFootprintChange | ||
DrawArea | ||
IsActive | (Inherited from DrawableEntity.) | |
IsPauseable | (Inherited from Entity.) | |
IsVisible | (Inherited from DrawableEntity.) | |
LastColor | ||
LastDrawArea | ||
NumberOfComponents | (Inherited from Entity.) | |
RenderLayer | (Inherited from DrawableEntity.) | |
Rotation | ||
RotationCenter | ||
Size | ||
TopLeft | ||
UpdatePriority | (Inherited from Entity.) |
Remarks
Examples
[Test] public void CreateEntity2D() { var entity = new Entity2D(DoubleSizedRectangle) { Color = Color.Green, Rotation = 15 }; Assert.AreEqual(DoubleSizedRectangle, entity.DrawArea); Assert.AreEqual(Color.Green, entity.Color); Assert.AreEqual(15, entity.Rotation); Assert.AreEqual(DrawableEntity.DefaultRenderLayer, entity.RenderLayer); Assert.AreEqual(Vector2D.One, entity.Center); Assert.AreEqual(new Size(2, 2), entity.Size); }
[Test] public void AddNewComponent() { var entity = new Entity2D(Rectangle.Zero); Assert.AreEqual(Rectangle.Zero, entity.DrawArea); Assert.AreEqual(Color.White, entity.Color); Assert.AreEqual(0, entity.NumberOfComponents); entity.Add(Size.Zero); Assert.AreEqual(1, entity.NumberOfComponents); }
[Test] public void SetDrawAreaProperties() { var entity = new Entity2D(Rectangle.One) { Color = Color.Blue, Center = Vector2D.One, Size = new Size(2) }; Assert.AreEqual(DoubleSizedRectangle, entity.DrawArea); entity.DrawArea = new Rectangle(-1, -1, 2, 2); Assert.AreEqual(Vector2D.Zero, entity.Center); entity.TopLeft = Vector2D.Zero; Assert.AreEqual(Vector2D.Zero, entity.TopLeft); Assert.AreEqual(DoubleSizedRectangle, entity.DrawArea); }
See Also