Class DungeonDrawerOptions
Options for the DungeonDrawer<TRoom> class.
Inheritance
Namespace: Edgar.GraphBasedGenerator.Grid2D.Drawing
Assembly: Edgar.dll
Syntax
public class DungeonDrawerOptions : Object
Remarks
It is possible to omit some of the Width, Height and Scale properties.
The drawer works like this:
If the width is set and the height is not set (and vice versa), the height is computed automatically based on the width/height ratio of the layout.
If the scale is not set, it is computed automatically in a way that the layout fits the image.
Constructors
DungeonDrawerOptions()
Declaration
public DungeonDrawerOptions()
Properties
BackgroundColor
Background color of the image.
Declaration
public Color BackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color |
EnableGridLines
Whether to enable grid lines.
Declaration
public bool EnableGridLines { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EnableHatching
Whether to enable hatching.
Declaration
public bool EnableHatching { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EnableShading
Whether to enable shading.
Declaration
public bool EnableShading { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
FontSize
The size (in tiles) of the font that is used to display room names.
Declaration
public float FontSize { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Examples
Value x: The font will have approximately the same height as x tiles in the image.
HatchingClusterOffset
Declaration
public Range<float> HatchingClusterOffset { get; set; }
Property Value
Type | Description |
---|---|
Range<System.Single> |
HatchingLength
Declaration
public Range<float> HatchingLength { get; set; }
Property Value
Type | Description |
---|---|
Range<System.Single> |
Height
Height of the drawing (in pixels).
Declaration
public Nullable<int> Height { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
PaddingAbsolute
The size (in pixels) of the padding (empty space) on each side of the drawing.
Declaration
public Nullable<int> PaddingAbsolute { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Remarks
Defaults to null. When null, the PaddingPercentage is used instead. Shading/hatching is not taken into account when computing the padding. That means that when padding is too small, parts of shading might be outside of the picture. At least 10% of the width of the drawing is recommended.
Examples
Value 100: There will be 100px gap on each side of the drawing.
PaddingPercentage
The size (fraction of the minimum of width and height of the drawing) of the padding on each side of the drawing.
Declaration
public float PaddingPercentage { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
This property is only used when PaddingAbsolute is null. Shading/hatching is not taken into account when computing the padding. That means that when padding is too small, parts of shading might be outside of the picture. At least 10% of the width of the drawing is recommended.
Examples
Value 0.1f and width set to 1000px and height set to 500px: There will be 50px (10% of 500px) gap on each side of the drawing.
RoomBackgroundColor
Background color of individual rooms.
Declaration
public Color RoomBackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color |
Scale
Scaling that will be applied to the layout.
Declaration
public Nullable<float> Scale { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Single> |
Remarks
It is automatically computed to fit the the drawing if left null.
Examples
Value 1.0: Layout is not scaled. Each point on the outline of each room is represented with a single pixel.
Value 10.0: Rooms are 10 times larger. 10 pixels are used to represent the line between two neighboring points.
ShowRoomNames
Whether to show room names or not.
Declaration
public bool ShowRoomNames { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Corridor names are never shown because there is usually not enough space to write the name.
Width
Width of the drawing (in pixels).
Declaration
public Nullable<int> Width { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |