Feature/tilemap editor (#237)
* feat: 添加 Tilemap 编辑器插件和组件生命周期支持 * feat(editor-core): 添加声明式插件注册 API * feat(editor-core): 改进tiledmap结构合并tileset进tiledmapeditor * feat: 添加 editor-runtime SDK 和插件系统改进 * fix(ci): 修复SceneResourceManager里变量未使用问题
This commit is contained in:
31
packages/tilemap-editor/src/tools/ITilemapTool.ts
Normal file
31
packages/tilemap-editor/src/tools/ITilemapTool.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Tilemap Tool Interface
|
||||
*/
|
||||
|
||||
import type { TilemapComponent } from '@esengine/tilemap';
|
||||
import type { TileSelection } from '../stores/TilemapEditorStore';
|
||||
|
||||
export interface ToolContext {
|
||||
tilemap: TilemapComponent;
|
||||
selectedTiles: TileSelection | null;
|
||||
currentLayer: number;
|
||||
layerLocked: boolean;
|
||||
brushSize: number;
|
||||
editingCollision: boolean;
|
||||
tileWidth: number;
|
||||
tileHeight: number;
|
||||
}
|
||||
|
||||
export interface ITilemapTool {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly icon: string;
|
||||
readonly cursor: string;
|
||||
|
||||
onMouseDown(tileX: number, tileY: number, ctx: ToolContext): void;
|
||||
onMouseMove(tileX: number, tileY: number, ctx: ToolContext): void;
|
||||
onMouseUp(tileX: number, tileY: number, ctx: ToolContext): void;
|
||||
|
||||
// Preview tiles to highlight during drag
|
||||
getPreviewTiles?(tileX: number, tileY: number, ctx: ToolContext): { x: number; y: number }[];
|
||||
}
|
||||
Reference in New Issue
Block a user