Create a quick and dirty style system.
This commit is contained in:
parent
c26dcfe3f3
commit
ecd31a5cde
@ -155,6 +155,11 @@ namespace Quik
|
|||||||
/// The line to draw.
|
/// The line to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikLine Line { get; }
|
public QuikLine Line { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the line.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle Style { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw line command.
|
/// Create a draw line command.
|
||||||
@ -178,6 +183,11 @@ namespace Quik
|
|||||||
/// The array of lines to draw.
|
/// The array of lines to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikLine[] Lines { get; }
|
public QuikLine[] Lines { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the lines.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle Style { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw lines command.
|
/// Create a draw lines command.
|
||||||
@ -201,6 +211,11 @@ namespace Quik
|
|||||||
/// The Bezier curve segments to draw.
|
/// The Bezier curve segments to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikBezier[] Segments;
|
public QuikBezier[] Segments;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the curve.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle Style { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw Bezier curve command.
|
/// Create a draw Bezier curve command.
|
||||||
@ -224,6 +239,21 @@ namespace Quik
|
|||||||
/// The rectangle to draw.
|
/// The rectangle to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikRectangle Rectangle { get; }
|
public QuikRectangle Rectangle { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the border.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill style of the contents.
|
||||||
|
/// </summary>
|
||||||
|
public QuikFillStyle FillStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Radius for round corners.
|
||||||
|
/// </summary>
|
||||||
|
public float CornerRadius { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw rectangle command.
|
/// Create a draw rectangle command.
|
||||||
@ -247,6 +277,21 @@ namespace Quik
|
|||||||
/// The rectangles to draw.
|
/// The rectangles to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikRectangle[] Rectangles { get; }
|
public QuikRectangle[] Rectangles { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the border.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill style of the contents.
|
||||||
|
/// </summary>
|
||||||
|
public QuikFillStyle FillStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Radius for round corners.
|
||||||
|
/// </summary>
|
||||||
|
public float CornerRadius { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw rectangles commands.
|
/// Create a draw rectangles commands.
|
||||||
@ -270,6 +315,16 @@ namespace Quik
|
|||||||
/// The ellipse to draw.
|
/// The ellipse to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikEllipse Ellipse { get; }
|
public QuikEllipse Ellipse { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the border.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill style of the contents.
|
||||||
|
/// </summary>
|
||||||
|
public QuikFillStyle FillStyle { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw ellipse command.
|
/// Create a draw ellipse command.
|
||||||
@ -293,6 +348,16 @@ namespace Quik
|
|||||||
/// The ellipses to draw.
|
/// The ellipses to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikEllipse[] Ellipses { get; }
|
public QuikEllipse[] Ellipses { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the border.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill style of the contents.
|
||||||
|
/// </summary>
|
||||||
|
public QuikFillStyle FillStyle { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw ellipses command.
|
/// Create a draw ellipses command.
|
||||||
@ -316,6 +381,16 @@ namespace Quik
|
|||||||
/// The triangle to draw.
|
/// The triangle to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikTriangle Triangle { get; }
|
public QuikTriangle Triangle { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the border.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill style of the contents.
|
||||||
|
/// </summary>
|
||||||
|
public QuikFillStyle FillStyle { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw triangle command.
|
/// Create a draw triangle command.
|
||||||
@ -339,6 +414,16 @@ namespace Quik
|
|||||||
/// The triangles to draw.
|
/// The triangles to draw.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikTriangle[] Triangles { get; }
|
public QuikTriangle[] Triangles { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the border.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill style of the contents.
|
||||||
|
/// </summary>
|
||||||
|
public QuikFillStyle FillStyle { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw triangles command.
|
/// Create a draw triangles command.
|
||||||
@ -363,6 +448,16 @@ namespace Quik
|
|||||||
/// The vertices that make up the polygon.
|
/// The vertices that make up the polygon.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public QuikVec2[] Polygon { get; }
|
public QuikVec2[] Polygon { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style of the border.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStrokeStyle StrokeStyle { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill style of the contents.
|
||||||
|
/// </summary>
|
||||||
|
public QuikFillStyle FillStyle { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a draw polygon command.
|
/// Create a draw polygon command.
|
||||||
|
70
Quik/QuikStyle.cs
Normal file
70
Quik/QuikStyle.cs
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
namespace Quik
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A line stipple pattern.
|
||||||
|
/// </summary>
|
||||||
|
public struct QuikStipplePattern
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The stipple pitch value.
|
||||||
|
/// </summary>
|
||||||
|
public float Pitch;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The stipple duty cycle.
|
||||||
|
/// </summary>
|
||||||
|
public float DutyCycle;
|
||||||
|
|
||||||
|
public QuikStipplePattern(float pitch, float dutyCycle)
|
||||||
|
{
|
||||||
|
Pitch = pitch;
|
||||||
|
DutyCycle = dutyCycle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static QuikStipplePattern None => new QuikStipplePattern(0.0f, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke style for lines and borders.
|
||||||
|
/// </summary>
|
||||||
|
public class QuikStrokeStyle
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke color.
|
||||||
|
/// </summary>
|
||||||
|
public QuikColor Color { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke width.
|
||||||
|
/// </summary>
|
||||||
|
public float Width { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stroke stipple pattern.
|
||||||
|
/// </summary>
|
||||||
|
public QuikStipplePattern StipplePattern { get; set; }
|
||||||
|
|
||||||
|
public QuikStrokeStyle()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public QuikStrokeStyle(QuikColor color, float width, QuikStipplePattern pattern)
|
||||||
|
{
|
||||||
|
Color = color;
|
||||||
|
Width = width;
|
||||||
|
StipplePattern = pattern;
|
||||||
|
}
|
||||||
|
|
||||||
|
public QuikStrokeStyle(QuikColor color, float width) : this(color, width, QuikStipplePattern.None)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Fill style for rectangles and the like.
|
||||||
|
/// </summary>
|
||||||
|
public class QuikFillStyle
|
||||||
|
{
|
||||||
|
public QuikColor Color { get; set; }
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user