Dual-grid autotile (Oskar Stålberg style). 更多...
#include <DualGrid.h>
Public 属性 | |
| int | filledGid = 0 |
| 0 = any non-zero logic GID counts as filled; else only this GID. | |
| int | firstDisplayGid = 0 |
| GID of atlas local id 0 on the display tileset. 0 = use display->getTilesetFirstGid() (fallback 1). | |
| bool | applyHalfOffset = true |
| Apply projection-correct half-step origin offset on the display layer. | |
| bool | hideLogic = true |
| Hide the logic layer after resolve (logic stays for gameplay queries). | |
| bool | useDefaultFrameTable = true |
| When true, use the default SpriteCook-style 4x4 atlas frame table. When false, GID = firstDisplayGid + mask (mask 0 → empty). | |
详细描述
Dual-grid autotile (Oskar Stålberg style).
Logic cells are painted on the world grid; display tiles sit on a second grid offset by half a step in the active projection, so each display cell samples exactly four logic cells (corners). That yields a 4-bit mask → 15 tiles (+ empty).
Works with Orthogonal / Isometric / Staggered / Hexagonal: the corner mask is computed in tile-index space; the display layer inherits orientation params and receives a projection-correct half-step origin offset.
Tiled does not provide this offset dual-grid workflow natively. Recommended authoring path: paint a binary logic tile layer in Tiled (or at runtime), then call resolveDualGrid() to fill a display TileLayer. Tiled's Terrain / Wang Corner Set is a related but different same-grid matching system.
在文件 DualGrid.h 第 28 行定义.
类成员变量说明
◆ applyHalfOffset
| bool eve::map::DualGridOptions::applyHalfOffset = true |
Apply projection-correct half-step origin offset on the display layer.
在文件 DualGrid.h 第 37 行定义.
被这些函数引用 eve::map::resolveDualGrid().
◆ filledGid
| int eve::map::DualGridOptions::filledGid = 0 |
0 = any non-zero logic GID counts as filled; else only this GID.
在文件 DualGrid.h 第 30 行定义.
被这些函数引用 eve::map::resolveDualGrid() , 以及 eve::map::Map::resolveDualGridFilled().
◆ firstDisplayGid
| int eve::map::DualGridOptions::firstDisplayGid = 0 |
GID of atlas local id 0 on the display tileset. 0 = use display->getTilesetFirstGid() (fallback 1).
在文件 DualGrid.h 第 35 行定义.
被这些函数引用 eve::map::resolveDualGrid().
◆ hideLogic
| bool eve::map::DualGridOptions::hideLogic = true |
Hide the logic layer after resolve (logic stays for gameplay queries).
在文件 DualGrid.h 第 39 行定义.
被这些函数引用 eve::map::resolveDualGrid().
◆ useDefaultFrameTable
| bool eve::map::DualGridOptions::useDefaultFrameTable = true |
When true, use the default SpriteCook-style 4x4 atlas frame table. When false, GID = firstDisplayGid + mask (mask 0 → empty).
在文件 DualGrid.h 第 44 行定义.
被这些函数引用 eve::map::resolveDualGrid().
该结构体的文档由以下文件生成:
- src/modules/map/DualGrid.h