Used to visualise how close to full or complete something is. eg. it could be used
for a health bar floating above a creep or as a progress bar. The percentile colors are
lerped between; eg. Three colors would give the color at 0%, 50% and 100%
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Entities Entity
DeltaEngine.Entities DrawableEntity
DeltaEngine.Rendering2D Entity2D
DeltaEngine.Rendering2D.Shapes Polygon2D
DeltaEngine.Rendering2D.Shapes FilledRect
DeltaEngine.Scenes.Controls PercentageBar
Namespace: DeltaEngine.Scenes.Controls
Assembly: DeltaEngine.Scenes (in DeltaEngine.Scenes.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The PercentageBar type exposes the following members.
Constructors
Name | Description | |
---|---|---|
PercentageBar | Initializes a new instance of the PercentageBar 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 | |
---|---|---|
Alignment | ||
Alpha | (Inherited from Entity2D.) | |
Center | (Inherited from Entity2D.) | |
Color | (Inherited from Entity2D.) | |
DidFootprintChange | (Inherited from Entity2D.) | |
DrawArea | (Inherited from Polygon2D.) | |
IsActive | (Inherited from DrawableEntity.) | |
IsPauseable | (Inherited from Entity.) | |
IsVisible | (Inherited from DrawableEntity.) | |
LastColor | (Inherited from Entity2D.) | |
LastDrawArea | (Inherited from Entity2D.) | |
Maximum | ||
MaxWidth | ||
Minimum | ||
NumberOfComponents | (Inherited from Entity.) | |
Percentage | ||
PercentileColors | ||
Points | (Inherited from Polygon2D.) | |
RenderLayer | (Inherited from DrawableEntity.) | |
Rotation | (Inherited from Entity2D.) | |
RotationCenter | (Inherited from Entity2D.) | |
Size | (Inherited from Entity2D.) | |
TopLeft | (Inherited from Entity2D.) | |
UpdatePriority | (Inherited from Entity.) | |
Value |
Remarks
Examples
[Test] public void RenderShrinkingLeftAlignedBar() { bar.Start<Shrink>(); }
[Test] public void RenderShrinkingCenterAlignedBar() { bar.Alignment = PercentageBar.HorizontalAlignment.Center; bar.Start<Shrink>(); }
[Test, CloseAfterFirstFrame] public void DefaultValues() { Assert.AreEqual(0, bar.Minimum); Assert.AreEqual(100, bar.Maximum); Assert.AreEqual(100, bar.Value); Assert.AreEqual(Center, bar.DrawArea); Assert.AreEqual(Width, bar.MaxWidth); Assert.AreEqual(HighColor, bar.Color); Assert.AreEqual(PercentileColors, bar.PercentileColors); Assert.AreEqual(PercentageBar.HorizontalAlignment.Left, bar.Alignment); }
See Also