Gondwana Game Engine Development (master) - 2.7.0
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
SceneLayerDefinition.cs
1using System.ComponentModel;
2using System.Drawing;
5
7
11public sealed class SceneLayerDefinition
12{
16 [Category("Identity")]
17 [Description("Unique identifier for this layer within the scene; leave blank to generate one when materialized.")]
18 public string ID { get; set; } = string.Empty;
19
23 [Category("Grid")]
24 [Description(
25 "How layer grid coordinates map to the scene: orthogonal uses rectangular rows and columns; other choices change the tile layout.")]
27
31 [Category("Grid")]
32 [Description("Number of grid cells across the layer. Together with TileWidth, determines its horizontal extent.")]
33 public int Columns { get; set; }
34
38 [Category("Grid")]
39 [Description("Number of grid cells down the layer. Together with TileHeight, determines its vertical extent.")]
40 public int Rows { get; set; }
41
45 [Category("Grid")]
46 [Description("Width in world pixels of one logical grid cell; does not change the source artwork.")]
47 public int TileWidth { get; set; } = 32;
48
52 [Category("Grid")]
53 [Description("Height in world pixels of one logical grid cell; does not change the source artwork.")]
54 public int TileHeight { get; set; } = 32;
55
59 [Category("Rendering")]
60 [Description("Draw order relative to other scene layers; higher values draw in front of lower values.")]
61 public int ZOrder { get; set; }
62
66 [Category("Rendering")]
67 [Description(
68 "Camera-scrolling multiplier for this layer. 1 follows normal world movement; 0.5 scrolls at half speed (distant background); above 1 scrolls faster; 0 does not shift with the camera.")]
69 public float Parallax { get; set; } = 1f;
70
74 [Category("Rendering")]
75 [Description(
76 "Whether this entire layer is drawn. False hides its contents without deleting the layer or its tiles.")]
77 public bool Visible { get; set; } = true;
78
82 [Category("Rendering")]
83 [Description("Repeat the layer horizontally as the camera moves beyond its left or right edge.")]
84 public bool WrapHorizontally { get; set; }
85
89 [Category("Rendering")]
90 [Description("Repeat the layer vertically as the camera moves beyond its top or bottom edge.")]
91 public bool WrapVertically { get; set; }
92
96 [Category("Debugging")]
97 [Description("Draw the layer's grid boundaries as an authoring/debug overlay; not part of the tile artwork.")]
98 public bool ShowGridLines { get; set; }
99
103 [Category("Debugging")]
104 [Description(
105 "Draw collision outlines for this layer as a debug overlay; does not turn collision detection on or off.")]
106 public bool ShowCollisionBoxes { get; set; }
107
111 [Category("Grid")]
112 [Description(
113 "World-pixel position of the layer's grid origin (cell 0,0); shifts the whole layer without changing tile coordinates.")]
114 public Point OriginPx { get; set; } = Point.Empty;
115
119 [Category("Collision")]
120 [Description("Collision profile name used by fixed tiles unless a tile specifies an override.")]
121 public string DefaultTileCollisionProfile { get; set; } = CollisionProfileNames.World;
122
126 [Category("Content")]
127 [Description("Saved placements and overrides for cells in this layer; missing cells use their implicit defaults.")]
128 public List<SceneLayerTileDefinition> Tiles { get; set; } = [];
129}
Defines one layer in a GSCN scene.
int TileWidth
Gets or sets the rendered tile width in pixels.
bool ShowGridLines
Gets or sets whether grid lines are shown.
bool ShowCollisionBoxes
Gets or sets whether collision boxes are shown.
int ZOrder
Gets or sets the layer render order.
Point OriginPx
Gets or sets the world-space origin of tile (0,0).
string ID
Gets or sets the stable layer identifier. An empty value generates a new ID when materialized.
string DefaultTileCollisionProfile
Gets or sets the collision profile assigned to fixed tiles by default.
float Parallax
Gets or sets the parallax factor.
int TileHeight
Gets or sets the rendered tile height in pixels.
List< SceneLayerTileDefinition > Tiles
Gets or sets tile entries. Coordinates identify the target cell; omitted cells remain default tiles.
bool Visible
Gets or sets whether the layer is visible.
int Columns
Gets or sets the number of tile columns.
int Rows
Gets or sets the number of tile rows.
CoordinateSystemTypes CoordinateSystemType
Gets or sets the coordinate system used by the layer.
bool WrapVertically
Gets or sets whether the layer wraps vertically.
bool WrapHorizontally
Gets or sets whether the layer wraps horizontally.
CoordinateSystemTypes
Identifies the layout and math rules used to map tiles to world pixels and world pixels back to grid ...