Inheritance Hierarchy
DeltaEngine.Entities Entity
DeltaEngine.Entities DrawableEntity
DeltaEngine.Rendering2D Entity2D
DeltaEngine.Rendering2D.Graphs GradientGraph
Namespace: DeltaEngine.Rendering2D.Graphs
Assembly: DeltaEngine.Rendering2D.Graphs (in DeltaEngine.Rendering2D.Graphs.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The GradientGraph type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | GradientGraph(Rectangle) | Initializes a new instance of the GradientGraph class |
![]() | GradientGraph(Rectangle, RangeGraph Color ) | Initializes a new instance of the GradientGraph 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 | (Inherited from Entity2D.) |
![]() | IsActive | (Inherited from DrawableEntity.) |
![]() | IsPauseable | (Inherited from Entity.) |
![]() | IsVisible | (Inherited from DrawableEntity.) |
![]() | LastColor | (Inherited from Entity2D.) |
![]() | LastDrawArea | (Inherited from Entity2D.) |
![]() | NumberOfComponents | (Inherited from Entity.) |
![]() | RenderLayer | (Inherited from DrawableEntity.) |
![]() | Rotation | (Inherited from Entity2D.) |
![]() | RotationCenter | (Inherited from Entity2D.) |
![]() | Size | (Inherited from Entity2D.) |
![]() | TopLeft | (Inherited from Entity2D.) |
![]() | UpdatePriority | (Inherited from Entity.) |
![]() | Values |
Remarks
Examples
[Test] public void DrawGradientGraph() { var colors = new List<Color>(new[] { Color.DarkGreen, Color.Red, Color.Orange, Color.Green, Color.Black, Color.Gold, Color.PaleGreen }); var colorRanges = new RangeGraph<Color>(colors); new GradientGraph(new Rectangle(0.1f, 0.4f, 0.8f, 0.2f), colorRanges); }
[Test] public void DrawGraphByAddingNewValues() { var graph = new GradientGraph(new Rectangle(0.1f, 0.4f, 0.8f, 0.2f)); graph.AddValueBefore(0, Color.Cyan); graph.AddValueAfter(0, Color.Purple); graph.SetValue(2, Color.Gold); Assert.AreEqual(3, graph.Values.Length); Assert.AreEqual(Color.Cyan, graph.Values[0]); Assert.AreEqual(Color.Purple, graph.Values[1]); Assert.AreEqual(Color.Gold, graph.Values[2]); }
[Test, CloseAfterFirstFrame] public void AddColorsToGradient() { var colors = new List<Color>(new[] { Color.DarkGreen, Color.Red, Color.Orange, Color.Green});
See Also