Gondwana Game Engine Development (master) - 2.6.1
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
TileBounds.cs
1using System.Drawing;
2
4
8public static class TileBounds
9{
19 internal static Rectangle GetTransformedTileCandidateRange(
20 Gondwana.Scenes.SceneLayer layer,
21 Rectangle query,
22 bool include)
23 {
24 if (!include || layer.TransformedTiles.Count == 0)
25 return query;
26
27 int width = layer.TileWidth;
28 int height = layer.TileHeight;
29 int spill = (Math.Abs(width - height) + 1) / 2;
30
31 if (spill == 0)
32 return query;
33
34 if (width > height)
35 query.Inflate(0, spill);
36 else
37 query.Inflate(spill, 0);
38
39 return query;
40 }
41
47 public static Rectangle ApplyTileGeometry(Rectangle cell, Tile tile, bool include)
48 {
49 if (!include) return cell;
50 return tile is Gondwana.Scenes.SceneLayerTile fixedTile
51 ? ApplyOverhang(TileTransformGeometry.GetVisualBounds(cell, Spacing.None, fixedTile.Transform), tile.Overhang, true)
52 : ApplyOverhang(cell, tile.Overhang, true);
53 }
64 public static Rectangle ApplyOverhang(Rectangle baseRect, Spacing oh, bool include)
65 {
66 if (!include || oh.IsEmpty)
67 return baseRect;
68
69 return Rectangle.FromLTRB(
70 baseRect.Left - oh.Left,
71 baseRect.Top - oh.Top,
72 baseRect.Right + oh.Right,
73 baseRect.Bottom + oh.Bottom
74 );
75 }
76}
@ Rectangle
Particles are spawned uniformly within a rectangular area. This is the default distribution.
record struct Spacing([property:JsonProperty("left")] int Left, [property:JsonProperty("top")] int Top, [property:JsonProperty("right")] int Right, [property:JsonProperty("bottom")] int Bottom)
Represents dimensions in pixels when spacing Tilesheets.
Definition Spacing.cs:12