Files
EVEngine/examples/building-tilemap
西风逍遥游 f7962f43fe feat(examples): developer-experience and AI-native showcase examples
- devlab: flagship --debug example (console/snapshot/AI panel/pause/hot
  reload/error slice), make devlab target with RUN_ARGS support
- ai-game: agent-drivable live game + agent_demo.py (pause/read/mutate/
  verify/snapshot/restore/screenshot loop)
- ai-editor: headless eve mcp editor host demo (JSON View + ViewModel MVVM)
- examples: fill all missing READMEs + config.nut, add examples/ index
- load.nut: add key_just_pressed/clampf/persist helpers; dedupe 19 examples
- rpg/cardgame: move JSON definitions to data files
- fix eve mcp crash: ModuleManager::requireAll() instantiates modules in
  the headless host (IEditorHost etc. were null)
- graphics: actionable screenshot error when readback was just enabled
- CI: smoke all examples (devlab with --debug) + DevLab hot-reload test

Fixes surfaced by the new CI smoke (examples had never been smoke-tested):
- scene_director kit: camera slot doubled as function + instance and was
  nulled by reset(); move the live Camera3D into cameraObj
- readTextFile used non-existent readn()/len(); use file.read()
  (rpg/cardgame/hex-levels)
- daynight used non-existent keyboard.wasPressed() -> key_just_pressed
- outline passed ints to float-only drawSolidRect; linear-structures
  slider passed an int value
- scene-ecs beginNode() requires (id, name); ai-stage guarded compilestring
- smoke_examples.sh: timeout -k 3 so SIGTERM-ignoring hosts cannot hang CI
2026-08-21 19:18:52 +08:00
..

Tilemap 建筑放置示例

演示在多样式 tilemap 上放置建筑:

  • map 模块创建等距(或六角)TileLayer,world.bindTileLayer(layer) 直接复用其投影
  • world.setTerrainGid(gid, semantic) 让地形语义从 tile GID 懒解析(水域/陆地)
  • eve.BuildingFx 按定义 visual2d 生成 2D 精灵,进入统一 2D 队列按脚点 Y 穿插
  • PlacementSession 封装放置 / 拆除 / 旋转 / 鬼影校验
make run/<platform>-debug GAME=examples/building-tilemap
输入 作用
1–3 选择建筑(房屋 / 码头 / 塔楼)
鼠标移动 鬼影跟随并吸附(等距/六角投影)
R 旋转
左键 放置
右键 拆除指针下建筑
T 切换网格叠加