miaoda-game-tube-phaser
v0.2.0
Published
Phaser Graphics renderer for painter-ordered miaoda-game-tube-core panels.
Readme
miaoda-game-tube-phaser
Phaser Graphics rendering for projected frames from miaoda-game-tube-core. It preserves painter order and converts centered, y-up core coordinates to Phaser's top-left, y-down screen space.
pnpm add miaoda-game-tube-phaser miaoda-game-tube-core phaserconst engine = new TubeEngine({sides: 12});
engine.resize(960, 540);
const renderer = new TubeRenderer(this.add.graphics(), 960, 540);
renderer.draw(engine.frame(camera, rings), quad => ({
color: quad.sideIndex % 2 === 0 ? 0x214768 : 0x17334d,
alpha: 1,
}));The style callback receives the full quad, including side index, ring references, and depth, so the game can choose bands, hazards, fog, biome colors, or distance shading. The caller owns the Graphics object and destroys it with the Scene. Resize both projection engine and renderer when the viewport changes.
